Skip to content

Commit 271ca48

Browse files
RasmusFonsecamontogeek
authored andcommitted
docs (guides): Missing line in diff and missing semicolons (#1907)
1 parent bd128a5 commit 271ca48

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/content/guides/production.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ __webpack.prod.js__
177177
+ sourceMap: true
178178
+ })
179179
]
180-
})
180+
});
181181
```
182182

183183
T> Avoid `inline-***` and `eval-***` use in production as they can increase bundle size and reduce the overall performance.
@@ -200,12 +200,13 @@ __webpack.prod.js__
200200
plugins: [
201201
new UglifyJSPlugin({
202202
sourceMap: true
203-
}),
203+
- })
204+
+ }),
204205
+ new webpack.DefinePlugin({
205206
+ 'process.env.NODE_ENV': JSON.stringify('production')
206207
+ })
207208
]
208-
})
209+
});
209210
```
210211

211212
T> Technically, `NODE_ENV` is a system environment variable that Node.js exposes into running scripts. It is used by convention to determine dev-vs-prod behavior by server tools, build scripts, and client-side libraries. Contrary to expectations, `process.env.NODE_ENV` is not set to `"production"` __within__ the build script `webpack.config.js`, see [#2537](https://github.com/webpack/webpack/issues/2537). Thus, conditionals like `process.env.NODE_ENV === 'production' ? '[name].[hash].bundle.js' : '[name].bundle.js'` within webpack configurations do not work as expected.

0 commit comments

Comments
 (0)