From 872c3c52f6ed28f0f1c43c0d81f373782840a73a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Mar 2023 00:29:52 +0000 Subject: [PATCH] Fix deprecated webpack configuration (#577) (#578) Signed-off-by: Sergey Myssak (cherry picked from commit f936098e4616f72c1f270bd72a28c2b652897108) Signed-off-by: github-actions[bot] --- src-docs/webpack.config.js | 6 +++--- src/webpack.config.js | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src-docs/webpack.config.js b/src-docs/webpack.config.js index 9aebf4f451..3ecca3d963 100644 --- a/src-docs/webpack.config.js +++ b/src-docs/webpack.config.js @@ -73,7 +73,7 @@ const webpackConfig = { rules: [ { test: /\.(js|tsx?)$/, - loaders: employCache([ + use: employCache([ { loader: 'babel-loader', options: { babelrc: false, ...babelConfig }, @@ -83,7 +83,7 @@ const webpackConfig = { }, { test: /\.scss$/, - loaders: employCache([ + use: employCache([ { loader: 'style-loader', options: { injectType: 'lazySingletonStyleTag' }, @@ -96,7 +96,7 @@ const webpackConfig = { }, { test: /\.css$/, - loaders: employCache(['style-loader', 'css-loader']), + use: employCache(['style-loader', 'css-loader']), exclude: /node_modules/, }, { diff --git a/src/webpack.config.js b/src/webpack.config.js index 998ef1ad95..f53cf12c2d 100644 --- a/src/webpack.config.js +++ b/src/webpack.config.js @@ -39,7 +39,6 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const isProduction = process.env.NODE_ENV === 'production'; const plugins = [ - new webpack.NoEmitOnErrorsPlugin(), new CircularDependencyPlugin({ exclude: /node_modules/, failOnError: true, @@ -98,12 +97,7 @@ module.exports = { }, { test: /\.scss$/, - loaders: [ - 'style-loader', - 'css-loader', - 'postcss-loader', - 'sass-loader', - ], + use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'], exclude: /node_modules/, }, { @@ -117,6 +111,8 @@ module.exports = { plugins, optimization: { - minimizer: isProduction ? [terserPlugin] : [], + minimize: isProduction, + minimizer: [terserPlugin], + noEmitOnErrors: true, }, };