pack: only install extension in debug mode
This commit is contained in:
1 parent
6faea38cc3
commit
d630a82dec
4 files changed
+13
-7
No files matched your search
@@ -98,6 +98,7 @@ baseConfig.files = [
|
||||
(Required) The files and folders listed below should not be included in the build.
|
||||
*/
|
||||
'dist/**/*',
|
||||
'!dist/main/index.dev.js',
|
||||
'!docs/**/*',
|
||||
'!tests/**/*',
|
||||
'!release/**/*'
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// Warning: This file is only used in the development environment
|
||||
// and is removed at build time.
|
||||
// Do not edit the file unless necessary.
|
||||
import { installExtension, VUEJS_DEVTOOLS } from 'electron-extension-installer'
|
||||
|
||||
installExtension(VUEJS_DEVTOOLS, {
|
||||
loadExtensionOptions: {
|
||||
allowFileAccess: true
|
||||
}
|
||||
})
|
||||
+1
-6
@@ -2,18 +2,13 @@ import { app, WebContents, RenderProcessGoneDetails } from 'electron'
|
||||
import Constants from './utils/Constants'
|
||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||
import { macOSDisableDefaultMenuItem } from './utils/Menus'
|
||||
import { installExtension, VUEJS_DEVTOOLS } from 'electron-extension-installer'
|
||||
|
||||
let mainWindow
|
||||
let errorWindow
|
||||
|
||||
app.on('ready', async () => {
|
||||
if (Constants.IS_DEV_ENV) {
|
||||
await installExtension(VUEJS_DEVTOOLS, {
|
||||
loadExtensionOptions: {
|
||||
allowFileAccess: true
|
||||
}
|
||||
})
|
||||
import('./index.dev')
|
||||
}
|
||||
macOSDisableDefaultMenuItem()
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ export default defineConfig(() => {
|
||||
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
||||
ElectronPlugin([
|
||||
{
|
||||
entry: ['src/main/index.ts'],
|
||||
entry: ['src/main/index.ts', 'src/main/index.dev.ts'],
|
||||
onstart: (options) => {
|
||||
options.startup()
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user