Spaces:
Sleeping
Sleeping
File size: 699 Bytes
bf8b26e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import { resolve } from 'path';
import { defineConfig } from 'vite';
export default defineConfig({
build: {
lib: {
entry: resolve('electron/preload/index.ts'),
formats: ['cjs'],
},
rollupOptions: {
external: ['electron'],
output: {
dir: 'build/electron',
/*
* preload must be cjs format.
* if mjs, it will be error:
* - Unable to load preload script.
* - SyntaxError: Cannot use import statement outside a module.
*/
entryFileNames: 'preload/[name].cjs',
format: 'cjs',
},
},
minify: false,
emptyOutDir: false,
},
esbuild: {
platform: 'node',
},
});
|