add Main, Preload vite.config.mjs
This commit is contained in:
parent
f39ceb67ad
commit
2fd327d49c
|
@ -0,0 +1,29 @@
|
||||||
|
import { builtinModules, createRequire } from 'module'
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url)
|
||||||
|
const pkg = require('../package.json')
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
mode: process.env.NODE_ENV,
|
||||||
|
// root: [path],
|
||||||
|
build: {
|
||||||
|
// outDir: [path],
|
||||||
|
lib: {
|
||||||
|
entry: 'index.ts',
|
||||||
|
formats: ['cjs'],
|
||||||
|
},
|
||||||
|
minify: process.env.NODE_ENV === 'production',
|
||||||
|
emptyOutDir: true,
|
||||||
|
rollupOptions: {
|
||||||
|
external: [
|
||||||
|
'electron',
|
||||||
|
...builtinModules,
|
||||||
|
...Object.keys(pkg.dependencies || {}),
|
||||||
|
],
|
||||||
|
output: {
|
||||||
|
entryFileNames: '[name].cjs',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
Loading…
Reference in New Issue