mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-31 20:16:36 +08:00
feat: multiple preload entry
This commit is contained in:
parent
a8ee36d62f
commit
0ac3c66087
@ -1,3 +1,4 @@
|
|||||||
|
import { join } from 'path'
|
||||||
import { builtinModules } from 'module'
|
import { builtinModules } from 'module'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import pkg from '../../package.json'
|
import pkg from '../../package.json'
|
||||||
@ -6,15 +7,19 @@ export default defineConfig({
|
|||||||
root: __dirname,
|
root: __dirname,
|
||||||
build: {
|
build: {
|
||||||
outDir: '../../dist/preload',
|
outDir: '../../dist/preload',
|
||||||
lib: {
|
|
||||||
entry: 'index.ts',
|
|
||||||
formats: ['cjs'],
|
|
||||||
fileName: () => '[name].cjs',
|
|
||||||
},
|
|
||||||
minify: process.env./* from mode option */NODE_ENV === 'production',
|
minify: process.env./* from mode option */NODE_ENV === 'production',
|
||||||
// https://github.com/caoxiemeihao/electron-vue-vite/issues/61
|
// https://github.com/caoxiemeihao/electron-vue-vite/issues/61
|
||||||
sourcemap: 'inline',
|
sourcemap: 'inline',
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
input: {
|
||||||
|
// multiple entry
|
||||||
|
index: join(__dirname, 'index.ts'),
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
format: 'cjs',
|
||||||
|
entryFileNames: '[name].cjs',
|
||||||
|
manualChunks: {},
|
||||||
|
},
|
||||||
external: [
|
external: [
|
||||||
'electron',
|
'electron',
|
||||||
...builtinModules,
|
...builtinModules,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user