1- import { FuseBox , CSSPlugin , Sparky , CopyPlugin } from ' fuse-box'
2- import { spawn } from ' child_process'
1+ import { FuseBox , CSSPlugin , Sparky , CopyPlugin } from " fuse-box"
2+ import { spawn } from " child_process"
33
44const DEV_PORT = 4445
5- const OUTPUT_DIR = ' out'
6- const ASSETS = [ ' *.jpg' , ' *.png' , ' *.jpeg' , ' *.gif' , ' *.svg' ]
5+ const OUTPUT_DIR = " out"
6+ const ASSETS = [ " *.jpg" , " *.png" , " *.jpeg" , " *.gif" , " *.svg" ]
77
88// are we running in production mode?
9- const isProduction = process . env . NODE_ENV === ' production'
9+ const isProduction = process . env . NODE_ENV === " production"
1010
1111// copy the renderer's html file into the right place
12- Sparky . task ( ' copy-html' , ( ) => {
13- return Sparky . src ( ' src/renderer/index.html' ) . dest ( `${ OUTPUT_DIR } /$name` )
12+ Sparky . task ( " copy-html" , ( ) => {
13+ return Sparky . src ( " src/renderer/index.html" ) . dest ( `${ OUTPUT_DIR } /$name` )
1414} )
1515
1616// the default task
17- Sparky . task ( ' default' , [ ' copy-html' ] , ( ) => {
17+ Sparky . task ( " default" , [ " copy-html" ] , ( ) => {
1818 // setup the producer with common settings
1919 const fuse = FuseBox . init ( {
20- homeDir : ' src' ,
20+ homeDir : " src" ,
2121 output : `${ OUTPUT_DIR } /$name.js` ,
22- target : ' electron' ,
22+ target : " electron" ,
2323 log : isProduction ,
2424 cache : ! isProduction ,
2525 sourceMaps : true ,
26- tsConfig : ' tsconfig.json' ,
26+ tsConfig : " tsconfig.json" ,
2727 } )
2828
2929 // start the hot reload server
@@ -32,7 +32,7 @@ Sparky.task('default', ['copy-html'], () => {
3232 }
3333
3434 // bundle the electron main code
35- const mainBundle = fuse . bundle ( ' main' ) . instructions ( ' > [main/main.ts]' )
35+ const mainBundle = fuse . bundle ( " main" ) . instructions ( " > [main/main.ts]" )
3636
3737 // and watch unless we're bundling for production
3838 if ( ! isProduction ) {
@@ -41,10 +41,10 @@ Sparky.task('default', ['copy-html'], () => {
4141
4242 // bundle the electron renderer code
4343 const rendererBundle = fuse
44- . bundle ( ' renderer' )
45- . instructions ( ' > [renderer/index.tsx] +fuse-box-css' )
44+ . bundle ( " renderer" )
45+ . instructions ( " > [renderer/index.tsx] +fuse-box-css" )
4646 . plugin ( CSSPlugin ( ) )
47- . plugin ( CopyPlugin ( { useDefault : false , files : ASSETS , dest : ' assets' , resolve : ' assets/' } ) )
47+ . plugin ( CopyPlugin ( { useDefault : false , files : ASSETS , dest : " assets" , resolve : " assets/" } ) )
4848
4949 // and watch & hot reload unless we're bundling for production
5050 if ( ! isProduction ) {
@@ -56,7 +56,7 @@ Sparky.task('default', ['copy-html'], () => {
5656 return fuse . run ( ) . then ( ( ) => {
5757 if ( ! isProduction ) {
5858 // startup electron
59- spawn ( ' node' , [ `${ __dirname } /node_modules/electron/cli.js` , __dirname ] , { stdio : ' inherit' } )
59+ spawn ( " node" , [ `${ __dirname } /node_modules/electron/cli.js` , __dirname ] , { stdio : " inherit" } )
6060 }
6161 } )
6262} )
0 commit comments