File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ const publicUrl = publicPath.slice(0, -1);
2424// Get environment variables to inject into our app.
2525const env = getClientEnvironment ( publicUrl ) ;
2626
27+ const useDebugger = process . env . ELM_DEBUGGER === 'true' ? true : false ;
28+
2729// Enable users to turn on dead code elimination.
2830const deadCodeElimination =
2931 process . env . DEAD_CODE_ELIMINATION === 'true'
@@ -213,8 +215,8 @@ module.exports = {
213215 options : {
214216 // If ELM_DEBUGGER was set to "true", enable it. Otherwise
215217 // for invalid values, "false" and as a default, disable it
216- debug : process . env . ELM_DEBUGGER === 'true' ? true : false ,
217- optimize : true ,
218+ debug : useDebugger ,
219+ optimize : ! useDebugger ,
218220 pathToElm : paths . elm
219221 }
220222 }
Original file line number Diff line number Diff line change @@ -82,7 +82,14 @@ measureFileSizesBeforeBuild(paths.appBuild)
8282
8383// Create the production build and print the deployment instructions.
8484function build ( previousFileSizes ) {
85- console . log ( `Creating an optimized ${ process . env . NODE_ENV } build...` ) ;
85+ const withDebugger = process . env . ELM_DEBUGGER === 'true' ? true : false ;
86+ if ( withDebugger ) {
87+ console . log (
88+ `Creating a ${ process . env . NODE_ENV } build with debugger enabled...`
89+ ) ;
90+ } else {
91+ console . log ( `Creating an optimized ${ process . env . NODE_ENV } build...` ) ;
92+ }
8693
8794 const compiler = webpack ( config ) ;
8895 return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments