Skip to content

Commit

Permalink
build(webpack): add flag fail-on-warnings for build prod
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <[email protected]>
  • Loading branch information
MyPyDavid committed Nov 27, 2024
1 parent 8d0db04 commit 9bc5100
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rdmo",
"scripts": {
"build:prod": "webpack --config webpack.config.js --mode production",
"build:prod": "webpack --config webpack.config.js --mode production --fail-on-warnings",
"build": "webpack --config webpack.config.js --mode development",
"watch": "webpack --config webpack.config.js --mode development --watch"
},
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const developmentConfig = {

// special config for production
const productionConfig = {
bail: true, // Stop the build on errors
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
Expand All @@ -125,7 +126,6 @@ const productionConfig = {
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
emitOnErrors: true // Fail build on errors
},
performance: {
hints: false // Suppress performance warnings in production
Expand Down

0 comments on commit 9bc5100

Please sign in to comment.