25 lines
582 B
JavaScript
25 lines
582 B
JavaScript
import { defineConfig } from 'vite';
|
|
|
|
// https://vitejs.dev/config
|
|
export default defineConfig({
|
|
resolve: {
|
|
// Some libs that can run in both Web and Node.js, such as `axios`, we need to tell Vite to build them in Node.js.
|
|
browserField: false,
|
|
mainFields: ['module', 'jsnext:main', 'jsnext'],
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
external: [
|
|
'sharp',
|
|
'node:worker_threads',
|
|
'node:process',
|
|
'node:fs',
|
|
'node:fs/promises',
|
|
'node:string_decoder',
|
|
'proper-lockfile',
|
|
'wasmagic',
|
|
]
|
|
}
|
|
}
|
|
});
|