mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
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:
@ -47,6 +47,7 @@
|
||||
"webpack-bundle-analyzer": "^4.4.0",
|
||||
"webpack-chain": "^6.5.1",
|
||||
"webpack-cli": "^4.5.0",
|
||||
"webpack-filter-warnings-plugin": "^1.2.1",
|
||||
"webpack-merge": "^5.4.0",
|
||||
"webpack-virtual-modules": "^0.4.2",
|
||||
"worker-plugin": "^5.0.0"
|
||||
|
@ -3,6 +3,7 @@ import Config from 'webpack-chain';
|
||||
import { resolve } from 'path';
|
||||
|
||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||
import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
import { CleanWebpackPlugin } from 'clean-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
|
||||
config.plugin('DefinePlugin').use(DefinePlugin, [
|
||||
{
|
||||
|
Reference in New Issue
Block a user