From 898c759f85ca792cec801691d66235954d24fa4b Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 11 Oct 2021 18:14:10 +0200 Subject: [PATCH] Fail the build when webpack has bundling warnings (early prevention of issues like microsoft/monaco-editor#2691) --- test/monaco/package.json | 3 ++- test/monaco/webpack.config.js | 6 +++++- test/monaco/yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/monaco/package.json b/test/monaco/package.json index 872fde3faca..3eb25726411 100644 --- a/test/monaco/package.json +++ b/test/monaco/package.json @@ -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" } } diff --git a/test/monaco/webpack.config.js b/test/monaco/webpack.config.js index 5e7e9c5f643..ccea6c1c7c9 100644 --- a/test/monaco/webpack.config.js +++ b/test/monaco/webpack.config.js @@ -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() + ], }; diff --git a/test/monaco/yarn.lock b/test/monaco/yarn.lock index f61353d112e..2af57c52c70 100644 --- a/test/monaco/yarn.lock +++ b/test/monaco/yarn.lock @@ -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==