mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: drop webpack-filter-warnings-plugin in favor of built-in ignoreWarnings
This commit is contained in:
@@ -15,6 +15,10 @@ exports[`angular configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/,
|
||||
/Zone\\\\.js does not support native async\\\\/await/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -215,12 +219,6 @@ exports[`angular configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -309,6 +307,10 @@ exports[`angular configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/,
|
||||
/Zone\\\\.js does not support native async\\\\/await/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -509,12 +511,6 @@ exports[`angular configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`base configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -213,12 +216,6 @@ exports[`base configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -297,6 +294,9 @@ exports[`base configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -495,12 +495,6 @@ exports[`base configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`javascript configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -240,12 +243,6 @@ exports[`javascript configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -335,6 +332,9 @@ exports[`javascript configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -560,12 +560,6 @@ exports[`javascript configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -228,12 +231,6 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -325,6 +322,9 @@ exports[`react configuration > android > base config 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -527,12 +527,6 @@ exports[`react configuration > android > base config 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -613,6 +607,9 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -826,12 +823,6 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -924,6 +915,9 @@ exports[`react configuration > ios > base config 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -1126,12 +1120,6 @@ exports[`react configuration > ios > base config 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`svelte configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -238,12 +241,6 @@ exports[`svelte configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -322,6 +319,9 @@ exports[`svelte configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -545,12 +545,6 @@ exports[`svelte configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`typescript configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -240,12 +243,6 @@ exports[`typescript configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -335,6 +332,9 @@ exports[`typescript configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -560,12 +560,6 @@ exports[`typescript configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ exports[`vue configuration for android 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/android/app/src/main/assets/app',
|
||||
pathinfo: false,
|
||||
@@ -245,12 +248,6 @@ exports[`vue configuration for android 1`] = `
|
||||
platform: 'android'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
@@ -329,6 +326,9 @@ exports[`vue configuration for ios 1`] = `
|
||||
'__jest__/App_Resources/**'
|
||||
]
|
||||
},
|
||||
ignoreWarnings: [
|
||||
/System.import\\\\(\\\\) is deprecated/
|
||||
],
|
||||
output: {
|
||||
path: '__jest__/platforms/ios/jest/app',
|
||||
pathinfo: false,
|
||||
@@ -559,12 +559,6 @@ exports[`vue configuration for ios 1`] = `
|
||||
platform: 'ios'
|
||||
}
|
||||
),
|
||||
/* config.plugin('FilterWarningsPlugin') */
|
||||
new FilterWarningsPlugin(
|
||||
{
|
||||
exclude: /System.import\\\\(\\\\) is deprecated/
|
||||
}
|
||||
),
|
||||
/* config.plugin('DefinePlugin') */
|
||||
new DefinePlugin(
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"scripts": {
|
||||
"build": "tsc --project tsconfig.build.json",
|
||||
"test": "jest",
|
||||
"prepack": "npm run build && cp -R src/stubs dist/stubs && chmod +x dist/bin/index.js"
|
||||
"prepack": "npm test && npm run build && cp -R src/stubs dist/stubs && chmod +x dist/bin/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.10",
|
||||
@@ -48,8 +48,6 @@
|
||||
"webpack": "^5.28.0",
|
||||
"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"
|
||||
|
||||
@@ -50,6 +50,22 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
},
|
||||
]);
|
||||
|
||||
// Filter common undesirable warnings
|
||||
config.set(
|
||||
'ignoreWarnings',
|
||||
(config.get('ignoreWarnings') ?? []).concat([
|
||||
/**
|
||||
* This rule hides
|
||||
* +-----------------------------------------------------------------------------------------+
|
||||
* | WARNING in Zone.js does not support native async/await in ES2017+. |
|
||||
* | These blocks are not intercepted by zone.js and will not triggering change detection. |
|
||||
* | See: https://github.com/angular/zone.js/pull/1140 for more information. |
|
||||
* +-----------------------------------------------------------------------------------------+
|
||||
*/
|
||||
/Zone\.js does not support native async\/await/,
|
||||
])
|
||||
);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ 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 TerserPlugin from 'terser-webpack-plugin';
|
||||
|
||||
@@ -266,19 +265,20 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
]);
|
||||
|
||||
// Filter common undesirable warnings
|
||||
config.plugin('FilterWarningsPlugin').use(FilterWarningsPlugin, [
|
||||
{
|
||||
config.set(
|
||||
'ignoreWarnings',
|
||||
(config.get('ignoreWarnings') ?? []).concat([
|
||||
/**
|
||||
* This rule hides
|
||||
* +-------------------------------------------------------------------------------+
|
||||
* | WARNING in ./node_modules/@angular/core/fesm2015/core.js 29714:15-102 |
|
||||
* | System.import() is deprecated and will be removed soon. Use import() instead. |
|
||||
* | For more info visit https://webpack.js.org/guides/code-splitting/ |
|
||||
* +-------------------------------------------------------------------------------+
|
||||
* +-----------------------------------------------------------------------------------------+
|
||||
* | WARNING in ./node_modules/@angular/core/fesm2015/core.js 29714:15-102 |
|
||||
* | System.import() is deprecated and will be removed soon. Use import() instead. |
|
||||
* | For more info visit https://webpack.js.org/guides/code-splitting/ |
|
||||
* +-----------------------------------------------------------------------------------------+
|
||||
*/
|
||||
exclude: /System.import\(\) is deprecated/,
|
||||
},
|
||||
]);
|
||||
/System.import\(\) is deprecated/,
|
||||
])
|
||||
);
|
||||
|
||||
// todo: refine defaults
|
||||
config.plugin('DefinePlugin').use(DefinePlugin, [
|
||||
|
||||
Reference in New Issue
Block a user