feat(webpack): filter common undesirable warnings by default (#9253)

* feat(webpack): filter common undesirable warnings by default

* style: move import line

Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
This commit is contained in:
Nathan Walker
2021-03-02 06:18:37 -08:00
committed by GitHub
parent 588989afa7
commit 99eca67a90
2 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,7 @@
"webpack-bundle-analyzer": "^4.4.0", "webpack-bundle-analyzer": "^4.4.0",
"webpack-chain": "^6.5.1", "webpack-chain": "^6.5.1",
"webpack-cli": "^4.5.0", "webpack-cli": "^4.5.0",
"webpack-filter-warnings-plugin": "^1.2.1",
"webpack-merge": "^5.4.0", "webpack-merge": "^5.4.0",
"webpack-virtual-modules": "^0.4.2", "webpack-virtual-modules": "^0.4.2",
"worker-plugin": "^5.0.0" "worker-plugin": "^5.0.0"

View File

@ -3,6 +3,7 @@ import Config from 'webpack-chain';
import { resolve } from 'path'; import { resolve } from 'path';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import { CleanWebpackPlugin } from 'clean-webpack-plugin'; import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin'; import TerserPlugin from 'terser-webpack-plugin';
@ -235,6 +236,13 @@ export default function (config: Config, env: IWebpackEnv): Config {
}, },
]); ]);
// useful for filtering common undesirable warnings
config.plugin('FilterWarningsPlugin').use(FilterWarningsPlugin, [
{
exclude: /System.import/,
},
]);
// todo: refine defaults // todo: refine defaults
config.plugin('DefinePlugin').use(DefinePlugin, [ config.plugin('DefinePlugin').use(DefinePlugin, [
{ {