refactor(vite.config): centralized configs
This commit is contained in:
1 parent
446a161565
commit
01ceddaf00
5 files changed
+13
-13
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { join } from 'path'
|
||||
import { builtinModules } from 'module'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
mode: process.env.NODE_ENV,
|
||||
root: join(__dirname, '../src/preload'),
|
||||
build: {
|
||||
outDir: join(__dirname, '../dist/preload'),
|
||||
lib: {
|
||||
entry: 'index.ts',
|
||||
formats: ['cjs'],
|
||||
},
|
||||
sourcemap: false,
|
||||
minify: false,
|
||||
emptyOutDir: true,
|
||||
rollupOptions: {
|
||||
external: [
|
||||
...builtinModules,
|
||||
'electron',
|
||||
],
|
||||
output: {
|
||||
entryFileNames: '[name].cjs',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user