mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 20:07:06 +08:00
28 lines
551 B
TypeScript
28 lines
551 B
TypeScript
import { join } from 'path'
|
|
import { builtinModules } from 'module'
|
|
import { defineConfig } from 'vite'
|
|
|
|
export default defineConfig({
|
|
mode: process.env.NODE_ENV,
|
|
root: join(__dirname, '../src/main'),
|
|
build: {
|
|
outDir: '../../dist/main',
|
|
lib: {
|
|
entry: 'index.ts',
|
|
formats: ['cjs'],
|
|
},
|
|
sourcemap: false,
|
|
minify: false,
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
external: [
|
|
...builtinModules,
|
|
'electron',
|
|
],
|
|
output: {
|
|
entryFileNames: '[name].cjs',
|
|
},
|
|
},
|
|
},
|
|
})
|