@@ -159,14 +159,6 @@ module.exports = (api, options) => {
159
159
)
160
160
// Prevent electron-builder from installing app deps
161
161
fs . ensureDirSync ( `${ outputDir } /bundled/node_modules` )
162
- // Copy fonts to css/fonts. Fixes some issues with static font imports
163
- if ( fs . existsSync ( api . resolve ( outputDir + '/bundled/fonts' ) ) ) {
164
- fs . ensureDirSync ( api . resolve ( outputDir + '/bundled/css/fonts' ) )
165
- fs . copySync (
166
- api . resolve ( outputDir + '/bundled/fonts' ) ,
167
- api . resolve ( outputDir + '/bundled/css/fonts' )
168
- )
169
- }
170
162
171
163
if ( bundleMainProcess ) {
172
164
// Build the main process into the renderer process output dir
@@ -210,7 +202,7 @@ module.exports = (api, options) => {
210
202
buildApp ( )
211
203
}
212
204
}
213
- function buildApp ( ) {
205
+ function buildApp ( ) {
214
206
info ( 'Building app with electron-builder:' )
215
207
// Build the app using electron builder
216
208
builder
@@ -319,31 +311,32 @@ module.exports = (api, options) => {
319
311
let child
320
312
let firstBundleCompleted = false
321
313
// Function to kill Electron process
322
- const killElectron = ( ) => new Promise ( resolve => {
323
- if ( ! child || child . killed ) {
324
- return resolve ( )
325
- }
326
-
327
- const currentChild = child
328
- currentChild . on ( 'exit' , ( ) => {
329
- resolve ( )
330
- } )
314
+ const killElectron = ( ) =>
315
+ new Promise ( resolve => {
316
+ if ( ! child || child . killed ) {
317
+ return resolve ( )
318
+ }
331
319
332
- // Attempt to kill gracefully
333
- if ( process . platform === 'win32' ) {
334
- currentChild . send ( 'graceful-exit' )
335
- } else {
336
- currentChild . kill ( 'SIGTERM' )
337
- }
320
+ const currentChild = child
321
+ currentChild . on ( 'exit' , ( ) => {
322
+ resolve ( )
323
+ } )
338
324
339
- // Kill unconditionally after 2 seconds if unsuccessful
340
- setTimeout ( ( ) => {
341
- if ( ! currentChild . killed ) {
342
- warn ( `Force killing Electron (process # ${ currentChild . pid } )` )
343
- currentChild . kill ( 'SIGKILL ' )
325
+ // Attempt to kill gracefully
326
+ if ( process . platform === 'win32' ) {
327
+ currentChild . send ( 'graceful-exit' )
328
+ } else {
329
+ currentChild . kill ( 'SIGTERM ' )
344
330
}
345
- } , 2000 )
346
- } )
331
+
332
+ // Kill unconditionally after 2 seconds if unsuccessful
333
+ setTimeout ( ( ) => {
334
+ if ( ! currentChild . killed ) {
335
+ warn ( `Force killing Electron (process #${ currentChild . pid } )` )
336
+ currentChild . kill ( 'SIGKILL' )
337
+ }
338
+ } , 2000 )
339
+ } )
347
340
348
341
// Initial start of Electron
349
342
startElectron ( )
@@ -382,7 +375,7 @@ module.exports = (api, options) => {
382
375
} )
383
376
}
384
377
385
- async function launchElectron ( ) {
378
+ async function launchElectron ( ) {
386
379
firstBundleCompleted = true
387
380
// Don't exit process when electron is killed
388
381
if ( child ) {
@@ -472,7 +465,7 @@ module.exports = (api, options) => {
472
465
}
473
466
}
474
467
475
- function onChildExit ( ) {
468
+ function onChildExit ( ) {
476
469
process . exit ( 0 )
477
470
}
478
471
}
@@ -518,7 +511,7 @@ module.exports = (api, options) => {
518
511
)
519
512
}
520
513
521
- function bundleMain ( {
514
+ function bundleMain ( {
522
515
mode,
523
516
api,
524
517
args,
@@ -570,7 +563,8 @@ function bundleMain ({
570
563
}
571
564
} )
572
565
// Enable/disable nodeIntegration
573
- envVars . ELECTRON_NODE_INTEGRATION = args . headless || pluginOptions . nodeIntegration || false
566
+ envVars . ELECTRON_NODE_INTEGRATION =
567
+ args . headless || pluginOptions . nodeIntegration || false
574
568
config . plugin ( 'env' ) . use ( webpack . EnvironmentPlugin , [ envVars ] )
575
569
576
570
if ( args . debug ) {
0 commit comments