Skip to content

Commit

Permalink
feat: Substitute __DEV__ according to NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrewe committed Sep 27, 2020
1 parent 309475a commit 644d6a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bundle/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function generateConfig({ extensions = [], // eslint-disable-next-line indent

let cfg = { sourcemap: sourcemaps };
let plugins = [];

let nodeEnv = process.env.NODE_ENV || "development";
if(esnext || jsx) {
let transpiler = Object.assign({}, esnext, jsx);
if(esnext) {
Expand Down Expand Up @@ -105,7 +105,8 @@ function generateConfig({ extensions = [], // eslint-disable-next-line indent
plugins = plugins.concat([
nodeResolve(resolve),
replace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development")
"process.env.NODE_ENV": JSON.stringify(nodeEnv),
__DEV__: JSON.stringify(nodeEnv !== "production")
}),
commonjs({ include: "node_modules/**" })
]);
Expand Down

0 comments on commit 644d6a3

Please sign in to comment.