mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-20 04:16:36 +08:00
25 lines
562 B
TypeScript
25 lines
562 B
TypeScript
|
import { builtinModules } from 'module'
|
||
|
import { defineConfig } from 'vite'
|
||
|
import pkg from '../../package.json'
|
||
|
|
||
|
export default defineConfig({
|
||
|
root: __dirname,
|
||
|
build: {
|
||
|
outDir: '../../dist/main',
|
||
|
lib: {
|
||
|
entry: 'index.ts',
|
||
|
formats: ['cjs'],
|
||
|
fileName: () => '[name].cjs',
|
||
|
},
|
||
|
minify: process.env./* from mode option */NODE_ENV === 'production',
|
||
|
emptyOutDir: true,
|
||
|
rollupOptions: {
|
||
|
external: [
|
||
|
'electron',
|
||
|
...builtinModules,
|
||
|
...Object.keys(pkg.dependencies || {}),
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
})
|