@tramvai/cli 2.130.9 → 2.130.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/library/webpack/application/client/common.js +3 -3
- package/lib/library/webpack/application/client/common.js.map +1 -1
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.js +10 -11
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.js.map +1 -1
- package/lib/library/webpack/constants/stats.d.ts +87 -0
- package/lib/library/webpack/constants/stats.js +3 -1
- package/lib/library/webpack/constants/stats.js.map +1 -1
- package/package.json +2 -2
- package/src/library/webpack/application/client/common.ts +9 -4
- package/src/library/webpack/application/client/prod/optimization/splitChunks.ts +10 -14
- package/src/library/webpack/constants/stats.ts +7 -0
|
@@ -20,7 +20,7 @@ const stats_1 = require("../../constants/stats");
|
|
|
20
20
|
const client_1 = require("../../blocks/pwa/client");
|
|
21
21
|
const ModuleFederationFixRange_1 = require("../../plugins/ModuleFederationFixRange");
|
|
22
22
|
exports.default = (configManager) => (config) => {
|
|
23
|
-
const { polyfill, fileSystemPages, shared } = configManager;
|
|
23
|
+
const { polyfill, fileSystemPages, shared, env } = configManager;
|
|
24
24
|
const portal = path_1.default.resolve(configManager.rootDir, `packages/${process.env.APP_ID}/portal.js`);
|
|
25
25
|
const polyfillPath = path_1.default.resolve(configManager.rootDir, polyfill !== null && polyfill !== void 0 ? polyfill : 'src/polyfill');
|
|
26
26
|
const portalExists = fs_1.default.existsSync(portal);
|
|
@@ -56,8 +56,8 @@ exports.default = (configManager) => (config) => {
|
|
|
56
56
|
.use(webpack_stats_plugin_1.StatsWriterPlugin, [
|
|
57
57
|
{
|
|
58
58
|
filename: configManager.modern ? 'stats.modern.json' : 'stats.json',
|
|
59
|
-
stats: stats_1.DEFAULT_STATS_OPTIONS,
|
|
60
|
-
fields: stats_1.DEFAULT_STATS_FIELDS,
|
|
59
|
+
stats: env === 'development' ? stats_1.DEV_STATS_OPTIONS : stats_1.DEFAULT_STATS_OPTIONS,
|
|
60
|
+
fields: env === 'development' ? stats_1.DEV_STATS_FIELDS : stats_1.DEFAULT_STATS_FIELDS,
|
|
61
61
|
},
|
|
62
62
|
])
|
|
63
63
|
.end()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../src/library/webpack/application/client/common.ts"],"names":[],"mappings":";;;AAAA,wDAAwB;AACxB,oDAAoB;AAEpB,+DAAyD;AAIzD,+DAAmE;AAEnE,qEAAuC;AACvC,sCAA8C;AAC9C,mFAA6C;AAC7C,iEAAiC;AACjC,iEAAiC;AACjC,qEAAqC;AACrC,mEAAmC;AACnC,uFAAuD;AACvD,iFAAiD;AACjD,4DAAyD;AACzD,0DAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../src/library/webpack/application/client/common.ts"],"names":[],"mappings":";;;AAAA,wDAAwB;AACxB,oDAAoB;AAEpB,+DAAyD;AAIzD,+DAAmE;AAEnE,qEAAuC;AACvC,sCAA8C;AAC9C,mFAA6C;AAC7C,iEAAiC;AACjC,iEAAiC;AACjC,qEAAqC;AACrC,mEAAmC;AACnC,uFAAuD;AACvD,iFAAiD;AACjD,4DAAyD;AACzD,0DAAuD;AACvD,iDAK+B;AAC/B,oDAAmD;AAEnD,qFAAkF;AAElF,kBAAe,CAAC,aAAoD,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE;IAC1F,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC;IAEjE,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,OAAO,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC;IAC/F,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,cAA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AAQ,CAAC,CAAC;SACvE,GAAG,EAAE;SACL,IAAI,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SAC5D,IAAI,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1E,MAAM,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,GAAG,CAAC,mDAAwB,EAAE;QACnF;YACE,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;SACrB;KACrC,CAAC,CAAC;IAEH,MAAM;SACH,MAAM,CAAC,cAAc,CAAC;SACtB,GAAG,CAAC,wCAAiB,EAAE;QACtB;YACE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY;YACnE,KAAK,EAAE,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,yBAAiB,CAAC,CAAC,CAAC,6BAAqB;YACxE,MAAM,EAAE,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,wBAAgB,CAAC,CAAC,CAAC,4BAAoB;SACxE;KACF,CAAC;SACD,GAAG,EAAE;SACL,MAAM,CAAC,QAAQ,CAAC;SAChB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;wCAER,IAAI,CAAC,CAAC,CAAC,KACV,qBAAqB,EAAE,IAAI,EAC3B,oBAAoB,EAAE,KAAK;KAE9B,CAAC,CAAC;IAEL,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -4,7 +4,6 @@ exports.splitChunksConfig = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
7
|
-
const sharedChunksNameCache = new WeakMap();
|
|
8
7
|
// based on [nextjs code](https://github.com/vercel/next.js/blob/aaeb349ce3e8c4c3435a43a29af4379266818e7b/packages/next/build/webpack-config.ts#L707)
|
|
9
8
|
const resolveFrameworksPaths = (rootDir, frameworksList) => {
|
|
10
9
|
const topLevelFrameworkPaths = [];
|
|
@@ -73,21 +72,21 @@ const splitChunksConfig = (configManager) => (config) => {
|
|
|
73
72
|
minSize: splitChunks.granularChunksMinSize,
|
|
74
73
|
reuseExistingChunk: true,
|
|
75
74
|
priority: 30,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
};
|
|
76
|
+
// too slow for development, default names is fast, but have one problem -
|
|
77
|
+
// we can find shared chunk filenames only in `chunks` stats property, not in `assetsByChunkName`
|
|
78
|
+
// https://github.com/webpack/webpack/issues/14433#issuecomment-938468513
|
|
79
|
+
if (env === 'production') {
|
|
80
|
+
shared.name = (module, chunks = []) => {
|
|
81
|
+
return crypto_1.default
|
|
81
82
|
.createHash('sha1')
|
|
82
83
|
.update(chunks.reduce((acc, chunk) => {
|
|
83
84
|
return acc + chunk.name;
|
|
84
85
|
}, ''))
|
|
85
86
|
.digest('hex')
|
|
86
|
-
.substring(0,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
};
|
|
87
|
+
.substring(0, 16);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
91
90
|
webpackSplitChunks = {
|
|
92
91
|
chunks: 'all',
|
|
93
92
|
maxInitialRequests: 10,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitChunks.js","sourceRoot":"","sources":["../../../../../../../src/library/webpack/application/client/prod/optimization/splitChunks.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AAGxB,4DAA4B;AAO5B,
|
|
1
|
+
{"version":3,"file":"splitChunks.js","sourceRoot":"","sources":["../../../../../../../src/library/webpack/application/client/prod/optimization/splitChunks.ts"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,CAAC,kBAAkB,CAAC;QAChC,8JAA8J;SAC7J,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE5B,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAxGS,QAAA,iBAAiB,qBAwG1B"}
|
|
@@ -1,3 +1,90 @@
|
|
|
1
1
|
import type { Configuration } from 'webpack';
|
|
2
2
|
export declare const DEFAULT_STATS_OPTIONS: Configuration['stats'];
|
|
3
3
|
export declare const DEFAULT_STATS_FIELDS: string[];
|
|
4
|
+
export declare const DEV_STATS_OPTIONS: {
|
|
5
|
+
chunks: boolean;
|
|
6
|
+
all?: boolean;
|
|
7
|
+
assets?: boolean;
|
|
8
|
+
assetsSort?: string;
|
|
9
|
+
assetsSpace?: number;
|
|
10
|
+
builtAt?: boolean;
|
|
11
|
+
cached?: boolean;
|
|
12
|
+
cachedAssets?: boolean;
|
|
13
|
+
cachedModules?: boolean;
|
|
14
|
+
children?: boolean;
|
|
15
|
+
chunkGroupAuxiliary?: boolean;
|
|
16
|
+
chunkGroupChildren?: boolean;
|
|
17
|
+
chunkGroupMaxAssets?: number;
|
|
18
|
+
chunkGroups?: boolean;
|
|
19
|
+
chunkModules?: boolean;
|
|
20
|
+
chunkModulesSpace?: number;
|
|
21
|
+
chunkOrigins?: boolean;
|
|
22
|
+
chunkRelations?: boolean;
|
|
23
|
+
chunksSort?: string;
|
|
24
|
+
colors?: boolean | {
|
|
25
|
+
bold?: string;
|
|
26
|
+
cyan?: string;
|
|
27
|
+
green?: string;
|
|
28
|
+
magenta?: string;
|
|
29
|
+
red?: string;
|
|
30
|
+
yellow?: string;
|
|
31
|
+
};
|
|
32
|
+
context?: string;
|
|
33
|
+
dependentModules?: boolean;
|
|
34
|
+
depth?: boolean;
|
|
35
|
+
entrypoints?: boolean | "auto";
|
|
36
|
+
env?: boolean;
|
|
37
|
+
errorDetails?: boolean | "auto";
|
|
38
|
+
errorStack?: boolean;
|
|
39
|
+
errors?: boolean;
|
|
40
|
+
errorsCount?: boolean;
|
|
41
|
+
errorsSpace?: number;
|
|
42
|
+
exclude?: string | boolean | RegExp | (string | RegExp | ((name: string, module: import("webpack").StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean))[] | ((name: string, module: import("webpack").StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean);
|
|
43
|
+
excludeAssets?: string | RegExp | (string | RegExp | ((name: string, asset: import("webpack").StatsAsset) => boolean))[] | ((name: string, asset: import("webpack").StatsAsset) => boolean);
|
|
44
|
+
excludeModules?: string | boolean | RegExp | (string | RegExp | ((name: string, module: import("webpack").StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean))[] | ((name: string, module: import("webpack").StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean);
|
|
45
|
+
groupAssetsByChunk?: boolean;
|
|
46
|
+
groupAssetsByEmitStatus?: boolean;
|
|
47
|
+
groupAssetsByExtension?: boolean;
|
|
48
|
+
groupAssetsByInfo?: boolean;
|
|
49
|
+
groupAssetsByPath?: boolean;
|
|
50
|
+
groupModulesByAttributes?: boolean;
|
|
51
|
+
groupModulesByCacheStatus?: boolean;
|
|
52
|
+
groupModulesByExtension?: boolean;
|
|
53
|
+
groupModulesByLayer?: boolean;
|
|
54
|
+
groupModulesByPath?: boolean;
|
|
55
|
+
groupModulesByType?: boolean;
|
|
56
|
+
groupReasonsByOrigin?: boolean;
|
|
57
|
+
hash?: boolean;
|
|
58
|
+
ids?: boolean;
|
|
59
|
+
logging?: boolean | "error" | "none" | "verbose" | "warn" | "info" | "log";
|
|
60
|
+
loggingDebug?: string | boolean | RegExp | (string | RegExp | ((value: string) => boolean))[] | ((value: string) => boolean);
|
|
61
|
+
loggingTrace?: boolean;
|
|
62
|
+
moduleAssets?: boolean;
|
|
63
|
+
moduleTrace?: boolean;
|
|
64
|
+
modules?: boolean;
|
|
65
|
+
modulesSort?: string;
|
|
66
|
+
modulesSpace?: number;
|
|
67
|
+
nestedModules?: boolean;
|
|
68
|
+
nestedModulesSpace?: number;
|
|
69
|
+
optimizationBailout?: boolean;
|
|
70
|
+
orphanModules?: boolean;
|
|
71
|
+
outputPath?: boolean;
|
|
72
|
+
performance?: boolean;
|
|
73
|
+
preset?: string | boolean;
|
|
74
|
+
providedExports?: boolean;
|
|
75
|
+
publicPath?: boolean;
|
|
76
|
+
reasons?: boolean;
|
|
77
|
+
reasonsSpace?: number;
|
|
78
|
+
relatedAssets?: boolean;
|
|
79
|
+
runtime?: boolean;
|
|
80
|
+
runtimeModules?: boolean;
|
|
81
|
+
source?: boolean;
|
|
82
|
+
timings?: boolean;
|
|
83
|
+
usedExports?: boolean;
|
|
84
|
+
version?: boolean;
|
|
85
|
+
warnings?: boolean;
|
|
86
|
+
warningsCount?: boolean;
|
|
87
|
+
warningsFilter?: string | RegExp | (string | RegExp | ((warning: import("webpack").StatsError, value: string) => boolean))[] | ((warning: import("webpack").StatsError, value: string) => boolean);
|
|
88
|
+
warningsSpace?: number;
|
|
89
|
+
};
|
|
90
|
+
export declare const DEV_STATS_FIELDS: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_STATS_FIELDS = exports.DEFAULT_STATS_OPTIONS = void 0;
|
|
3
|
+
exports.DEV_STATS_FIELDS = exports.DEV_STATS_OPTIONS = exports.DEFAULT_STATS_FIELDS = exports.DEFAULT_STATS_OPTIONS = void 0;
|
|
4
4
|
exports.DEFAULT_STATS_OPTIONS = {
|
|
5
5
|
all: false,
|
|
6
6
|
publicPath: true,
|
|
@@ -17,4 +17,6 @@ exports.DEFAULT_STATS_FIELDS = [
|
|
|
17
17
|
'namedChunkGroups',
|
|
18
18
|
'entrypoints',
|
|
19
19
|
];
|
|
20
|
+
exports.DEV_STATS_OPTIONS = Object.assign(Object.assign({}, exports.DEFAULT_STATS_OPTIONS), { chunks: true });
|
|
21
|
+
exports.DEV_STATS_FIELDS = [...exports.DEFAULT_STATS_FIELDS, 'chunks'];
|
|
20
22
|
//# sourceMappingURL=stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/library/webpack/constants/stats.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAA2B;IAC3D,GAAG,EAAE,KAAK;IAEV,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,GAAG,EAAE,IAAI;IACT,WAAW,EAAE,IAAI,EAAE,mDAAmD;CACvE,CAAC;AAEW,QAAA,oBAAoB,GAAa;IAC5C,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,kBAAkB;IAClB,aAAa;CACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/library/webpack/constants/stats.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAA2B;IAC3D,GAAG,EAAE,KAAK;IAEV,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,GAAG,EAAE,IAAI;IACT,WAAW,EAAE,IAAI,EAAE,mDAAmD;CACvE,CAAC;AAEW,QAAA,oBAAoB,GAAa;IAC5C,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,kBAAkB;IAClB,aAAa;CACd,CAAC;AAEW,QAAA,iBAAiB,mCACzB,6BAAqB,KACxB,MAAM,EAAE,IAAI,IACZ;AAEW,QAAA,gBAAgB,GAAG,CAAC,GAAG,4BAAoB,EAAE,QAAQ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "2.130.
|
|
3
|
+
"version": "2.130.11",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@tinkoff/utils": "^2.1.3",
|
|
72
72
|
"@tinkoff/webpack-dedupe-plugin": "1.0.5",
|
|
73
73
|
"@tramvai/build": "3.1.4",
|
|
74
|
-
"@tramvai/react": "2.130.
|
|
74
|
+
"@tramvai/react": "2.130.11",
|
|
75
75
|
"@tramvai/tools-check-versions": "0.4.17",
|
|
76
76
|
"@tramvai/tools-migrate": "0.6.21",
|
|
77
77
|
"ajv": "^6.12.6",
|
|
@@ -18,13 +18,18 @@ import postcssAssets from '../../blocks/postcssAssets';
|
|
|
18
18
|
import nodeClient from '../../blocks/nodeClient';
|
|
19
19
|
import { pagesResolve } from '../../blocks/pagesResolve';
|
|
20
20
|
import { configToEnv } from '../../blocks/configToEnv';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
DEFAULT_STATS_OPTIONS,
|
|
23
|
+
DEFAULT_STATS_FIELDS,
|
|
24
|
+
DEV_STATS_OPTIONS,
|
|
25
|
+
DEV_STATS_FIELDS,
|
|
26
|
+
} from '../../constants/stats';
|
|
22
27
|
import { pwaBlock } from '../../blocks/pwa/client';
|
|
23
28
|
import type { ModuleFederationFixRangeOptions } from '../../plugins/ModuleFederationFixRange';
|
|
24
29
|
import { ModuleFederationFixRange } from '../../plugins/ModuleFederationFixRange';
|
|
25
30
|
|
|
26
31
|
export default (configManager: ConfigManager<ApplicationConfigEntry>) => (config: Config) => {
|
|
27
|
-
const { polyfill, fileSystemPages, shared } = configManager;
|
|
32
|
+
const { polyfill, fileSystemPages, shared, env } = configManager;
|
|
28
33
|
|
|
29
34
|
const portal = path.resolve(configManager.rootDir, `packages/${process.env.APP_ID}/portal.js`);
|
|
30
35
|
const polyfillPath = path.resolve(configManager.rootDir, polyfill ?? 'src/polyfill');
|
|
@@ -65,8 +70,8 @@ export default (configManager: ConfigManager<ApplicationConfigEntry>) => (config
|
|
|
65
70
|
.use(StatsWriterPlugin, [
|
|
66
71
|
{
|
|
67
72
|
filename: configManager.modern ? 'stats.modern.json' : 'stats.json',
|
|
68
|
-
stats: DEFAULT_STATS_OPTIONS,
|
|
69
|
-
fields: DEFAULT_STATS_FIELDS,
|
|
73
|
+
stats: env === 'development' ? DEV_STATS_OPTIONS : DEFAULT_STATS_OPTIONS,
|
|
74
|
+
fields: env === 'development' ? DEV_STATS_FIELDS : DEFAULT_STATS_FIELDS,
|
|
70
75
|
},
|
|
71
76
|
])
|
|
72
77
|
.end()
|
|
@@ -8,8 +8,6 @@ import type { ApplicationConfigEntry } from '../../../../../../typings/configEnt
|
|
|
8
8
|
|
|
9
9
|
import type { SplitChunksOptions } from '../../../../types/webpack';
|
|
10
10
|
|
|
11
|
-
const sharedChunksNameCache = new WeakMap<any, string>();
|
|
12
|
-
|
|
13
11
|
// based on [nextjs code](https://github.com/vercel/next.js/blob/aaeb349ce3e8c4c3435a43a29af4379266818e7b/packages/next/build/webpack-config.ts#L707)
|
|
14
12
|
const resolveFrameworksPaths = (rootDir: string, frameworksList: string[]) => {
|
|
15
13
|
const topLevelFrameworkPaths: string[] = [];
|
|
@@ -94,12 +92,14 @@ export const splitChunksConfig =
|
|
|
94
92
|
minSize: splitChunks.granularChunksMinSize,
|
|
95
93
|
reuseExistingChunk: true,
|
|
96
94
|
priority: 30,
|
|
97
|
-
|
|
98
|
-
if (sharedChunksNameCache.has(module)) {
|
|
99
|
-
return sharedChunksNameCache.get(module);
|
|
100
|
-
}
|
|
95
|
+
};
|
|
101
96
|
|
|
102
|
-
|
|
97
|
+
// too slow for development, default names is fast, but have one problem -
|
|
98
|
+
// we can find shared chunk filenames only in `chunks` stats property, not in `assetsByChunkName`
|
|
99
|
+
// https://github.com/webpack/webpack/issues/14433#issuecomment-938468513
|
|
100
|
+
if (env === 'production') {
|
|
101
|
+
shared.name = (module: webpack.Module, chunks: webpack.Chunk[] = []) => {
|
|
102
|
+
return crypto
|
|
103
103
|
.createHash('sha1')
|
|
104
104
|
.update(
|
|
105
105
|
chunks.reduce((acc: string, chunk: webpack.Chunk) => {
|
|
@@ -107,13 +107,9 @@ export const splitChunksConfig =
|
|
|
107
107
|
}, '')
|
|
108
108
|
)
|
|
109
109
|
.digest('hex')
|
|
110
|
-
.substring(0,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return name;
|
|
115
|
-
},
|
|
116
|
-
};
|
|
110
|
+
.substring(0, 16);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
117
113
|
|
|
118
114
|
webpackSplitChunks = {
|
|
119
115
|
chunks: 'all',
|
|
@@ -18,3 +18,10 @@ export const DEFAULT_STATS_FIELDS: string[] = [
|
|
|
18
18
|
'namedChunkGroups',
|
|
19
19
|
'entrypoints',
|
|
20
20
|
];
|
|
21
|
+
|
|
22
|
+
export const DEV_STATS_OPTIONS = {
|
|
23
|
+
...DEFAULT_STATS_OPTIONS,
|
|
24
|
+
chunks: true, // нужно, чтобы получить название файлов для shared чанков в development режиме
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const DEV_STATS_FIELDS = [...DEFAULT_STATS_FIELDS, 'chunks'];
|