File tree Expand file tree Collapse file tree 3 files changed +19
-14
lines changed
packages/node_modules/overmind-devtools Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const serverPath = path.join(__dirname, 'src/main.js')
88
99const args = [ serverPath ]
1010 . concat ( [ ] . concat ( process . argv ) . splice ( 2 ) )
11- . concat ( '--not-packaged=true' )
11+ // .concat('--not-packaged=true')
1212
1313const env = Object . create ( process . env )
1414env . NODE_ENV = 'production'
Original file line number Diff line number Diff line change 99 "overmind-devtools" : " bin.js"
1010 },
1111 "scripts" : {
12- "start" : " electron ./src/main" ,
12+ "start" : " electron ./src/main" ,
13+ "prod" : " NODE_ENV=production electron ./src/main --not-packaged=true" ,
1314 "build" : " rimraf devtoolsDist && cp -R ../overmind-devtools-client/dist devtoolsDist"
1415 },
1516 "keywords" : [
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ function createWindow() {
1717 minWidth : 500 ,
1818 } )
1919
20+ electron . protocol . registerFileProtocol ( 'filestub' , ( request , callback ) => {
21+ const url = request . url . substr ( 10 )
22+ const file = { path : path . normalize ( `${ path . join ( __dirname , '..' ) } /${ url } ` ) }
23+
24+ callback ( file )
25+ } )
26+
2027 const devtoolBackend = DevtoolBackend . create ( {
2128 onRelaunch ( ) {
2229 app . relaunch ( )
@@ -61,18 +68,15 @@ function createWindow() {
6168
6269 function openDevtools ( port ) {
6370 if ( process . env . NODE_ENV === 'production' ) {
64- mainWindow . loadURL (
65- 'data:text/html;charset=UTF-8,' +
66- encodeURIComponent (
67- devtoolBackend . getMarkup ( 'bundle.js' , port , onPortSubmit , onRestart )
68- ) ,
69- {
70- baseURLForDataURL : `file://${ path . join (
71- __dirname ,
72- '..'
73- ) } /devtoolsDist/`,
74- }
75- )
71+ mainWindow . loadURL (
72+ 'data:text/html;charset=UTF-8,' +
73+ encodeURIComponent (
74+ devtoolBackend . getMarkup ( 'bundle.js' , port , onPortSubmit , onRestart )
75+ ) ,
76+ {
77+ baseURLForDataURL : `filestub://devtoolsDist/` ,
78+ }
79+ )
7680 } else {
7781 mainWindow . loadURL ( 'http://localhost:8080' )
7882 mainWindow . webContents . openDevTools ( )
You can’t perform that action at this time.
0 commit comments