pack: change vite.config.ts config

This commit is contained in:
leejooy96 committed 2023-03-12 15:09:51 +09:00
1 parent 56b158ff67
commit 1df8fdb26a
2 files changed
+159 -5849

No files matched your search

+144 -5839
View File
File diff suppressed because it is too large. Load diff
+15 -10
View File
@@ -10,9 +10,10 @@ import { rmSync } from 'fs'
import { resolve, dirname } from 'path' import { resolve, dirname } from 'path'
import { builtinModules } from 'module' import { builtinModules } from 'module'
export default defineConfig(() => {
rmSync('dist', { recursive: true, force: true }) rmSync('dist', { recursive: true, force: true })
export default defineConfig({ return {
define: { define: {
__VUE_I18N_FULL_INSTALL__: true, __VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: false, __VUE_I18N_LEGACY_API__: false,
@@ -43,18 +44,10 @@ export default defineConfig({
eslintPlugin(), eslintPlugin(),
// Docs: https://github.com/electron-vite/vite-plugin-electron // Docs: https://github.com/electron-vite/vite-plugin-electron
electronPlugin([ electronPlugin([
{
entry: ['src/preload/index.ts'],
vite: {
build: {
outDir: 'dist/preload'
}
}
},
{ {
entry: ['src/main/index.ts'], entry: ['src/main/index.ts'],
onstart: (options) => { onstart: (options) => {
options.startup(['.', '--no-sandbox']) options.startup()
}, },
vite: { vite: {
build: { build: {
@@ -65,8 +58,20 @@ export default defineConfig({
} }
} }
} }
},
{
entry: ['src/preload/index.ts'],
onstart: (options) => {
options.reload()
},
vite: {
build: {
outDir: 'dist/preload'
}
}
} }
]), ]),
rendererPlugin() rendererPlugin()
] ]
}
}) })