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.
|
(Required) The files and folders listed below should not be included in the build.
|
||||||
*/
|
*/
|
||||||
'dist/**/*',
|
'dist/**/*',
|
||||||
|
'!dist/main/index.dev.js',
|
||||||
'!docs/**/*',
|
'!docs/**/*',
|
||||||
'!tests/**/*',
|
'!tests/**/*',
|
||||||
'!release/**/*'
|
'!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 Constants from './utils/Constants'
|
||||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||||
import { macOSDisableDefaultMenuItem } from './utils/Menus'
|
import { macOSDisableDefaultMenuItem } from './utils/Menus'
|
||||||
import { installExtension, VUEJS_DEVTOOLS } from 'electron-extension-installer'
|
|
||||||
|
|
||||||
let mainWindow
|
let mainWindow
|
||||||
let errorWindow
|
let errorWindow
|
||||||
|
|
||||||
app.on('ready', async () => {
|
app.on('ready', async () => {
|
||||||
if (Constants.IS_DEV_ENV) {
|
if (Constants.IS_DEV_ENV) {
|
||||||
await installExtension(VUEJS_DEVTOOLS, {
|
import('./index.dev')
|
||||||
loadExtensionOptions: {
|
|
||||||
allowFileAccess: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
macOSDisableDefaultMenuItem()
|
macOSDisableDefaultMenuItem()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ export default defineConfig(() => {
|
|||||||
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
||||||
ElectronPlugin([
|
ElectronPlugin([
|
||||||
{
|
{
|
||||||
entry: ['src/main/index.ts'],
|
entry: ['src/main/index.ts', 'src/main/index.dev.ts'],
|
||||||
onstart: (options) => {
|
onstart: (options) => {
|
||||||
options.startup()
|
options.startup()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user