Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const publicUrl = publicPath.slice(0, -1);
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);

const useDebugger = process.env.ELM_DEBUGGER === 'true' ? true : false;

// Enable users to turn on dead code elimination.
const deadCodeElimination =
process.env.DEAD_CODE_ELIMINATION === 'true'
Expand Down Expand Up @@ -213,8 +215,8 @@ module.exports = {
options: {
// If ELM_DEBUGGER was set to "true", enable it. Otherwise
// for invalid values, "false" and as a default, disable it
debug: process.env.ELM_DEBUGGER === 'true' ? true : false,
optimize: true,
debug: useDebugger,
optimize: !useDebugger,
pathToElm: paths.elm
}
}
Expand Down
9 changes: 8 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ measureFileSizesBeforeBuild(paths.appBuild)

// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
console.log(`Creating an optimized ${process.env.NODE_ENV} build...`);
const withDebugger = process.env.ELM_DEBUGGER === 'true' ? true : false;
if (withDebugger) {
console.log(
`Creating a ${process.env.NODE_ENV} build with debugger enabled...`
);
} else {
console.log(`Creating an optimized ${process.env.NODE_ENV} build...`);
}

const compiler = webpack(config);
return new Promise((resolve, reject) => {
Expand Down