File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,13 @@ import {isDev} from "./env";
33import { WindowConfig } from "../config/window" ;
44
55export const DevToolsManager = {
6+ enable : true ,
67 rowCount : 4 ,
78 colCount : 3 ,
89 windows : new Map < BrowserWindow | BrowserView , BrowserWindow > ( ) ,
10+ setEnable ( enable : boolean ) {
11+ DevToolsManager . enable = enable
12+ } ,
913 getWindow ( win : BrowserWindow | BrowserView ) {
1014 return this . windows . get ( win ) ;
1115 } ,
@@ -68,13 +72,13 @@ export const DevToolsManager = {
6872 }
6973 } ,
7074 register ( name : string , win : BrowserWindow | BrowserView ) {
71- if ( ! isDev ) {
75+ if ( ! isDev || ! DevToolsManager . enable ) {
7276 return
7377 }
7478 this . getOrCreateWindow ( name , win ) ;
7579 } ,
7680 autoShow ( win : BrowserWindow | BrowserView ) {
77- if ( ! isDev ) {
81+ if ( ! isDev || ! DevToolsManager . enable ) {
7882 return
7983 }
8084 if ( WindowConfig . alwaysOpenDevTools ) {
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ import {AppsMain} from "../mapi/app/main";
2323
2424const isDummyNew = isDummy
2525
26+ if ( process . env [ 'ELECTRON_ENV_PROD' ] ) {
27+ DevToolsManager . setEnable ( false )
28+ }
29+
2630process . on ( 'uncaughtException' , ( error ) => {
2731 console . error ( 'Uncaught Exception:' , error ) ;
2832} ) ;
Original file line number Diff line number Diff line change 2121 "type" : " module" ,
2222 "scripts" : {
2323 "dev" : " vite" ,
24+ "dev:pre" : " export ELECTRON_ENV_PROD=1 && vite" ,
2425 "dev:win" : " chcp 65001 && vite" ,
25- "dev_debug " : " vite --debug" ,
26+ "dev:debug " : " vite --debug" ,
2627 "build" : " vite build && electron-builder" ,
2728 "build:debug" : " export VSCODE_DEBUG=true && vite build && electron-builder" ,
2829 "build:win" : " vite build && electron-builder --win" ,
You can’t perform that action at this time.
0 commit comments