Fail the build when webpack has bundling warnings (early prevention of issues like microsoft/monaco-editor#2691)

This commit is contained in:
Alex Dima 2021-10-11 18:14:10 +02:00
parent c15218d09e
commit 898c759f85
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
3 changed files with 12 additions and 2 deletions

View file

@ -11,6 +11,7 @@
},
"devDependencies": {
"@types/chai": "^4.2.14",
"chai": "^4.2.0"
"chai": "^4.2.0",
"warnings-to-errors-webpack-plugin": "^2.3.0"
}
}

View file

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
const path = require('path');
const WarningsToErrorsPlugin = require('warnings-to-errors-webpack-plugin');
module.exports = {
mode: 'production',
@ -51,5 +52,8 @@ module.exports = {
moduleTrace: true,
errorDetails: true,
chunks: true
}
},
plugins: [
new WarningsToErrorsPlugin()
],
};

View file

@ -50,3 +50,8 @@ type-detect@^4.0.0, type-detect@^4.0.5:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
warnings-to-errors-webpack-plugin@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/warnings-to-errors-webpack-plugin/-/warnings-to-errors-webpack-plugin-2.3.0.tgz#5f9a58aaec458feafabe0f7a2b88a492db263a30"
integrity sha512-fzOyw+Ctr2MqJ+4UXKobDiOLzMMSBAdvGMWvZ4NRgTBCofAL2mmdfr6/Of3Bqz9Sq6R6xT5dLs6nnLLCtmppeQ==