pack: modify vite.config.js for new vite-plugin-electron version
This commit is contained in:
1 parent
d41c9e0903
commit
7b7eb80620
1 file changed
+23
-6
+23
-6
@@ -1,9 +1,12 @@
|
|||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import electronPlugin from 'vite-plugin-electron'
|
import electronPlugin from 'vite-plugin-electron'
|
||||||
|
import rendererPlugin from 'vite-plugin-electron-renderer'
|
||||||
import eslintPlugin from 'vite-plugin-eslint'
|
import eslintPlugin from 'vite-plugin-eslint'
|
||||||
|
import vuetifyPlugin from 'vite-plugin-vuetify'
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import pkg from './package.json'
|
||||||
import { resolve, dirname } from 'path'
|
import { resolve, dirname } from 'path'
|
||||||
import { builtinModules } from 'module'
|
import { builtinModules } from 'module'
|
||||||
|
|
||||||
@@ -23,15 +26,27 @@ export default defineConfig({
|
|||||||
root: resolve('./src/renderer'),
|
root: resolve('./src/renderer'),
|
||||||
publicDir: resolve('./src/renderer/public'),
|
publicDir: resolve('./src/renderer/public'),
|
||||||
build: {
|
build: {
|
||||||
outDir: resolve('./dist')
|
outDir: resolve('./dist'),
|
||||||
|
rollupOptions: {
|
||||||
|
external: Object.keys(pkg.dependencies)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
|
// Docs: https://github.com/vuetifyjs/vuetify-loader
|
||||||
|
vuetifyPlugin({
|
||||||
|
autoImport: true
|
||||||
|
}),
|
||||||
|
// Docs: https://github.com/gxmari007/vite-plugin-eslint
|
||||||
eslintPlugin(),
|
eslintPlugin(),
|
||||||
electronPlugin({
|
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
||||||
main: {
|
electronPlugin([
|
||||||
entry: 'src/main/index.ts',
|
{
|
||||||
|
entry: ['src/main/index.ts'],
|
||||||
|
onstart: (options) => {
|
||||||
|
options.startup(['.', '--no-sandbox'])
|
||||||
|
},
|
||||||
vite: {
|
vite: {
|
||||||
publicDir: resolve('./src/main'),
|
publicDir: resolve('./src/main'),
|
||||||
build: {
|
build: {
|
||||||
@@ -43,8 +58,10 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
renderer: {}
|
]),
|
||||||
|
rendererPlugin({
|
||||||
|
nodeIntegration: true
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user