@statoscope/stats-validator-plugin-webpack
Advanced tools
Comparing version 5.10.3 to 5.11.0
@@ -10,3 +10,3 @@ import { NormalizedChunk, NormalizedCompilation, NormalizedEntrypointItem } from '@statoscope/webpack-model/dist/normalize'; | ||
}; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry'>; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry' | 'asset'>; | ||
export declare type Params = { | ||
@@ -13,0 +13,0 @@ exclude?: Array<string | RegExp | RuleExcludeItem>; |
@@ -43,3 +43,6 @@ "use strict"; | ||
$useCompressedSize: [$params.useCompressedSize, true].useNotNullish(); | ||
$getSizeByChunks: => files.(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
$getSizeByChunks: => files.exclude({ | ||
exclude: $params.exclude.[type='asset'].name, | ||
get: <name>, | ||
}).(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
@@ -46,0 +49,0 @@ $input.compilations |
@@ -5,3 +5,3 @@ import { NormalizedChunk, NormalizedCompilation, NormalizedEntrypointItem } from '@statoscope/webpack-model/dist/normalize'; | ||
import { WebpackRule } from '../../'; | ||
import { ByNameFilterItem, ExcludeItem, SerializedExcludeItem } from '../../limits-helpers'; | ||
import { ByNameFilterItem, ExcludeItem } from '../../limits-helpers'; | ||
declare type NetworkType = typeof networkListType[number]['name']; | ||
@@ -18,4 +18,3 @@ export declare type Limits = { | ||
}; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry'>; | ||
export declare type SerializedRuleExcludeItem = SerializedExcludeItem<'compilation' | 'entry'>; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry' | 'asset'>; | ||
export declare type Params = { | ||
@@ -22,0 +21,0 @@ useCompressedSize?: boolean; |
@@ -67,3 +67,6 @@ "use strict"; | ||
$network: [$params.network, 'Slow'].useNotNullish(); | ||
$getSizeByChunks: => files.(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
$getSizeByChunks: => files.exclude({ | ||
exclude: $params.exclude.[type='asset'].name, | ||
get: <name>, | ||
}).(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
@@ -70,0 +73,0 @@ $input.compilations |
@@ -9,3 +9,3 @@ import { NormalizedChunk, NormalizedCompilation, NormalizedEntrypointItem } from '@statoscope/webpack-model/dist/normalize'; | ||
}; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry'>; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry' | 'asset'>; | ||
export declare type Params = { | ||
@@ -35,5 +35,5 @@ exclude?: Array<string | RegExp | RuleExcludeItem>; | ||
export declare type NormalizedParams = Exclude<Params, 'exclude'> & { | ||
exclude: ExcludeItem<'compilation' | 'entry'>[]; | ||
exclude: RuleExcludeItem[]; | ||
}; | ||
declare const entryDownloadSizeLimits: WebpackRule<Params>; | ||
export default entryDownloadSizeLimits; |
@@ -37,3 +37,6 @@ "use strict"; | ||
$useCompressedSize: [$params.useCompressedSize, true].useNotNullish(); | ||
$getSizeByChunks: => files.(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
$getSizeByChunks: => files.exclude({ | ||
exclude: $params.exclude.[type='asset'].name, | ||
get: <name>, | ||
}).(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
@@ -40,0 +43,0 @@ $input.compilations |
@@ -11,3 +11,3 @@ import { NormalizedChunk, NormalizedCompilation, NormalizedEntrypointItem } from '@statoscope/webpack-model/dist/normalize'; | ||
}; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry'>; | ||
export declare type RuleExcludeItem = ExcludeItem<'compilation' | 'entry' | 'asset'>; | ||
export declare type Params = { | ||
@@ -38,5 +38,5 @@ exclude?: Array<string | RegExp | RuleExcludeItem>; | ||
useCompressedSize: boolean; | ||
exclude: ExcludeItem<'compilation' | 'entry'>[]; | ||
exclude: RuleExcludeItem[]; | ||
}; | ||
declare const entryDownloadTimeLimits: WebpackRule<Params>; | ||
export default entryDownloadTimeLimits; |
@@ -39,3 +39,6 @@ "use strict"; | ||
$network: [$params.network, 'Slow'].useNotNullish(); | ||
$getSizeByChunks: => files.(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
$getSizeByChunks: => files.exclude({ | ||
exclude: $params.exclude.[type='asset'].name, | ||
get: <name>, | ||
}).(getAssetSize($$, $useCompressedSize!=false)).reduce(=> size + $$, 0); | ||
@@ -42,0 +45,0 @@ $input.compilations |
{ | ||
"name": "@statoscope/stats-validator-plugin-webpack", | ||
"version": "5.10.3", | ||
"version": "5.11.0", | ||
"description": "Plugin for @statoscope/stats-validator to validate webpack stats", | ||
@@ -25,3 +25,3 @@ "main": "./dist/index.js", | ||
"@statoscope/types": "5.9.0", | ||
"@statoscope/webpack-model": "5.9.0", | ||
"@statoscope/webpack-model": "5.11.0", | ||
"chalk": "^4.1.2", | ||
@@ -33,3 +33,3 @@ "semver": "^7.3.5" | ||
}, | ||
"gitHead": "1902b1d718fb063bd306fe5bda1686a59809b8cc" | ||
"gitHead": "08e84826c7527e36ba838796609daf1b4fbb6324" | ||
} |
@@ -21,6 +21,34 @@ # stats-validator-plugin-webpack | ||
plugins: ['@statoscope/webpack'], | ||
rules: { | ||
// ensures that build-time of your bundle hasn't exceeded 10 sec | ||
'@statoscope/webpack/build-time-limits': ['error', {global: 10000}], | ||
// any other rules | ||
// rules to validate your stats (use all of them or only specific rules) | ||
rules: { | ||
// ensures that the build time has not exceeded the limit (10 sec) | ||
'@statoscope/webpack/build-time-limits': ['error', 10000], | ||
// ensures that bundle doesn't use specified modules | ||
'@statoscope/webpack/restricted-modules': ['error', [/some-package\/dist/some-module\.js/]], | ||
// ensures that bundle doesn't use specified packages | ||
'@statoscope/webpack/restricted-packages': ['error', ['lodash', 'browserify-crypto']], | ||
// ensures that bundle hasn't package duplicates | ||
'@statoscope/webpack/no-packages-dups': ['error'], | ||
// ensure that the download time of entrypoints is not over the limit (3 sec) | ||
'@statoscope/webpack/entry-download-time-limits': ['error', { global: { maxDownloadTime: 3000 } }], | ||
// ensure that the download size of entrypoints is not over the limit (3 mb) | ||
'@statoscope/webpack/entry-download-size-limits': ['error', { global: { maxSize: 3 * 1024 * 1024 } }], | ||
// ensures that bundle doesn't have modules with deoptimization | ||
'@statoscope/webpack/no-modules-deopts': ['warn'], | ||
// compares build time between input and reference stats. Fails if build time diff is the limit (3 sec) | ||
'@statoscope/webpack/diff-build-time-limits': ['error', 3000], | ||
// diff download size of entrypoints between input and reference stats. Fails if size diff is over the limit (3 kb) | ||
'@statoscope/webpack/diff-entry-download-size-limits': [ | ||
'error', | ||
{ global: { maxSizeDiff: 3 * 1024 } }, | ||
], | ||
// diff download time of entrypoints between input and reference stats. Fails if download time is over the limit (500 ms) | ||
'@statoscope/webpack/diff-entry-download-time-limits': [ | ||
'error', | ||
{ global: { maxDownloadTimeDiff: 500 } }, | ||
], | ||
// compares usage of specified modules between input and reference stats | ||
'@statoscope/webpack/diff-deprecated-modules': ['error', [/\/path\/to\/module\.js/]], | ||
// compares usage of specified packages usage between input and reference stats. Fails if rxjs usage has increased | ||
'@statoscope/webpack/diff-deprecated-packages': ['error', ['rxjs']], | ||
} | ||
@@ -27,0 +55,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90918
2079
72
+ Added@statoscope/webpack-model@5.11.0(transitive)
- Removed@statoscope/webpack-model@5.9.0(transitive)