@tramvai/cli 3.27.4 → 3.30.1
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/builder/webpack/tokens.d.ts +3 -0
- package/lib/builder/webpack/tokens.d.ts.map +1 -1
- package/lib/di/tokens/config.d.ts +1 -0
- package/lib/di/tokens/config.d.ts.map +1 -1
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.d.ts +1 -0
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.d.ts.map +1 -1
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.js +3 -2
- package/lib/library/webpack/application/client/prod/optimization/splitChunks.js.map +1 -1
- package/lib/library/webpack/application/server/prod.d.ts.map +1 -1
- package/lib/library/webpack/application/server/prod.js +3 -0
- package/lib/library/webpack/application/server/prod.js.map +1 -1
- package/lib/library/webpack/blocks/optimize.d.ts.map +1 -1
- package/lib/library/webpack/blocks/optimize.js +3 -0
- package/lib/library/webpack/blocks/optimize.js.map +1 -1
- package/lib/library/webpack/child-app/client/common.d.ts.map +1 -1
- package/lib/library/webpack/child-app/client/common.js +7 -0
- package/lib/library/webpack/child-app/client/common.js.map +1 -1
- package/lib/library/webpack/child-app/common.d.ts.map +1 -1
- package/lib/library/webpack/child-app/common.js +50 -5
- package/lib/library/webpack/child-app/common.js.map +1 -1
- package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts.map +1 -1
- package/lib/library/webpack/plugins/ModuleFederationFixRange.js +2 -1
- package/lib/library/webpack/plugins/ModuleFederationFixRange.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +117 -15
- package/lib/typings/configEntry/cli.d.ts +6 -0
- package/lib/typings/configEntry/cli.d.ts.map +1 -1
- package/package.json +4 -3
- package/schema.json +117 -15
- package/src/library/webpack/application/client/prod/optimization/splitChunks.ts +1 -1
- package/src/library/webpack/application/server/prod.ts +4 -0
- package/src/library/webpack/blocks/optimize.ts +4 -0
- package/src/library/webpack/child-app/client/common.ts +8 -0
- package/src/library/webpack/child-app/common.ts +66 -6
- package/src/library/webpack/plugins/ModuleFederationFixRange.ts +2 -1
- package/src/models/config.spec.ts +4 -0
- package/src/schema/autogeneratedSchema.json +117 -15
- package/src/schema/tramvai.spec.ts +2 -0
- package/src/typings/configEntry/cli.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.1",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@discoveryjs/json-ext": "^0.5.7",
|
|
57
57
|
"@fastify/compress": "^6.2.0",
|
|
58
58
|
"@fastify/static": "^6.9.0",
|
|
59
|
+
"@loadable/webpack-plugin": "^5.15.0",
|
|
59
60
|
"@module-federation/node": "^0.15.1",
|
|
60
61
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
61
62
|
"@sentry/node": "^6.2.5",
|
|
@@ -67,11 +68,11 @@
|
|
|
67
68
|
"@tinkoff/minicss-class-generator": "0.3.1",
|
|
68
69
|
"@tinkoff/package-manager-wrapper": "0.2.2",
|
|
69
70
|
"@tinkoff/request-core": "^0.9.2",
|
|
70
|
-
"@tinkoff/request-plugin-protocol-http": "^0.
|
|
71
|
+
"@tinkoff/request-plugin-protocol-http": "^0.12.1",
|
|
71
72
|
"@tinkoff/utils": "^2.1.3",
|
|
72
73
|
"@tinkoff/webpack-dedupe-plugin": "2.0.2",
|
|
73
74
|
"@tramvai/build": "4.1.1",
|
|
74
|
-
"@tramvai/react": "3.
|
|
75
|
+
"@tramvai/react": "3.30.1",
|
|
75
76
|
"@tramvai/tools-check-versions": "0.5.3",
|
|
76
77
|
"@tramvai/tools-migrate": "0.7.3",
|
|
77
78
|
"ajv": "^8.12.0",
|
package/schema.json
CHANGED
|
@@ -918,6 +918,40 @@
|
|
|
918
918
|
}
|
|
919
919
|
},
|
|
920
920
|
"additionalProperties": false
|
|
921
|
+
},
|
|
922
|
+
"minifier": {
|
|
923
|
+
"cli_overridable": "",
|
|
924
|
+
"title": "specify minifer for terser plugin",
|
|
925
|
+
"default": "terser",
|
|
926
|
+
"anyOf": [
|
|
927
|
+
{
|
|
928
|
+
"type": "object",
|
|
929
|
+
"properties": {
|
|
930
|
+
"development": {
|
|
931
|
+
"enum": [
|
|
932
|
+
"swc",
|
|
933
|
+
"terser"
|
|
934
|
+
],
|
|
935
|
+
"type": "string"
|
|
936
|
+
},
|
|
937
|
+
"production": {
|
|
938
|
+
"enum": [
|
|
939
|
+
"swc",
|
|
940
|
+
"terser"
|
|
941
|
+
],
|
|
942
|
+
"type": "string"
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
"additionalProperties": false
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
"enum": [
|
|
949
|
+
"swc",
|
|
950
|
+
"terser"
|
|
951
|
+
],
|
|
952
|
+
"type": "string"
|
|
953
|
+
}
|
|
954
|
+
]
|
|
921
955
|
}
|
|
922
956
|
},
|
|
923
957
|
"additionalProperties": false
|
|
@@ -1166,23 +1200,23 @@
|
|
|
1166
1200
|
"dotAll": {
|
|
1167
1201
|
"type": "boolean"
|
|
1168
1202
|
},
|
|
1169
|
-
"__@match@
|
|
1203
|
+
"__@match@6864": {
|
|
1170
1204
|
"type": "object",
|
|
1171
1205
|
"additionalProperties": false
|
|
1172
1206
|
},
|
|
1173
|
-
"__@replace@
|
|
1207
|
+
"__@replace@6866": {
|
|
1174
1208
|
"type": "object",
|
|
1175
1209
|
"additionalProperties": false
|
|
1176
1210
|
},
|
|
1177
|
-
"__@search@
|
|
1211
|
+
"__@search@6869": {
|
|
1178
1212
|
"type": "object",
|
|
1179
1213
|
"additionalProperties": false
|
|
1180
1214
|
},
|
|
1181
|
-
"__@split@
|
|
1215
|
+
"__@split@6871": {
|
|
1182
1216
|
"type": "object",
|
|
1183
1217
|
"additionalProperties": false
|
|
1184
1218
|
},
|
|
1185
|
-
"__@matchAll@
|
|
1219
|
+
"__@matchAll@6873": {
|
|
1186
1220
|
"type": "object",
|
|
1187
1221
|
"additionalProperties": false
|
|
1188
1222
|
}
|
|
@@ -1658,6 +1692,40 @@
|
|
|
1658
1692
|
}
|
|
1659
1693
|
},
|
|
1660
1694
|
"additionalProperties": false
|
|
1695
|
+
},
|
|
1696
|
+
"minifier": {
|
|
1697
|
+
"cli_overridable": "",
|
|
1698
|
+
"title": "specify minifer for terser plugin",
|
|
1699
|
+
"default": "terser",
|
|
1700
|
+
"anyOf": [
|
|
1701
|
+
{
|
|
1702
|
+
"type": "object",
|
|
1703
|
+
"properties": {
|
|
1704
|
+
"development": {
|
|
1705
|
+
"enum": [
|
|
1706
|
+
"swc",
|
|
1707
|
+
"terser"
|
|
1708
|
+
],
|
|
1709
|
+
"type": "string"
|
|
1710
|
+
},
|
|
1711
|
+
"production": {
|
|
1712
|
+
"enum": [
|
|
1713
|
+
"swc",
|
|
1714
|
+
"terser"
|
|
1715
|
+
],
|
|
1716
|
+
"type": "string"
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
"additionalProperties": false
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
"enum": [
|
|
1723
|
+
"swc",
|
|
1724
|
+
"terser"
|
|
1725
|
+
],
|
|
1726
|
+
"type": "string"
|
|
1727
|
+
}
|
|
1728
|
+
]
|
|
1661
1729
|
}
|
|
1662
1730
|
},
|
|
1663
1731
|
"additionalProperties": false
|
|
@@ -1844,23 +1912,23 @@
|
|
|
1844
1912
|
"dotAll": {
|
|
1845
1913
|
"type": "boolean"
|
|
1846
1914
|
},
|
|
1847
|
-
"__@match@
|
|
1915
|
+
"__@match@6864": {
|
|
1848
1916
|
"type": "object",
|
|
1849
1917
|
"additionalProperties": false
|
|
1850
1918
|
},
|
|
1851
|
-
"__@replace@
|
|
1919
|
+
"__@replace@6866": {
|
|
1852
1920
|
"type": "object",
|
|
1853
1921
|
"additionalProperties": false
|
|
1854
1922
|
},
|
|
1855
|
-
"__@search@
|
|
1923
|
+
"__@search@6869": {
|
|
1856
1924
|
"type": "object",
|
|
1857
1925
|
"additionalProperties": false
|
|
1858
1926
|
},
|
|
1859
|
-
"__@split@
|
|
1927
|
+
"__@split@6871": {
|
|
1860
1928
|
"type": "object",
|
|
1861
1929
|
"additionalProperties": false
|
|
1862
1930
|
},
|
|
1863
|
-
"__@matchAll@
|
|
1931
|
+
"__@matchAll@6873": {
|
|
1864
1932
|
"type": "object",
|
|
1865
1933
|
"additionalProperties": false
|
|
1866
1934
|
}
|
|
@@ -2336,6 +2404,40 @@
|
|
|
2336
2404
|
}
|
|
2337
2405
|
},
|
|
2338
2406
|
"additionalProperties": false
|
|
2407
|
+
},
|
|
2408
|
+
"minifier": {
|
|
2409
|
+
"cli_overridable": "",
|
|
2410
|
+
"title": "specify minifer for terser plugin",
|
|
2411
|
+
"default": "terser",
|
|
2412
|
+
"anyOf": [
|
|
2413
|
+
{
|
|
2414
|
+
"type": "object",
|
|
2415
|
+
"properties": {
|
|
2416
|
+
"development": {
|
|
2417
|
+
"enum": [
|
|
2418
|
+
"swc",
|
|
2419
|
+
"terser"
|
|
2420
|
+
],
|
|
2421
|
+
"type": "string"
|
|
2422
|
+
},
|
|
2423
|
+
"production": {
|
|
2424
|
+
"enum": [
|
|
2425
|
+
"swc",
|
|
2426
|
+
"terser"
|
|
2427
|
+
],
|
|
2428
|
+
"type": "string"
|
|
2429
|
+
}
|
|
2430
|
+
},
|
|
2431
|
+
"additionalProperties": false
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
"enum": [
|
|
2435
|
+
"swc",
|
|
2436
|
+
"terser"
|
|
2437
|
+
],
|
|
2438
|
+
"type": "string"
|
|
2439
|
+
}
|
|
2440
|
+
]
|
|
2339
2441
|
}
|
|
2340
2442
|
},
|
|
2341
2443
|
"additionalProperties": false
|
|
@@ -2522,23 +2624,23 @@
|
|
|
2522
2624
|
"dotAll": {
|
|
2523
2625
|
"type": "boolean"
|
|
2524
2626
|
},
|
|
2525
|
-
"__@match@
|
|
2627
|
+
"__@match@6864": {
|
|
2526
2628
|
"type": "object",
|
|
2527
2629
|
"additionalProperties": false
|
|
2528
2630
|
},
|
|
2529
|
-
"__@replace@
|
|
2631
|
+
"__@replace@6866": {
|
|
2530
2632
|
"type": "object",
|
|
2531
2633
|
"additionalProperties": false
|
|
2532
2634
|
},
|
|
2533
|
-
"__@search@
|
|
2635
|
+
"__@search@6869": {
|
|
2534
2636
|
"type": "object",
|
|
2535
2637
|
"additionalProperties": false
|
|
2536
2638
|
},
|
|
2537
|
-
"__@split@
|
|
2639
|
+
"__@split@6871": {
|
|
2538
2640
|
"type": "object",
|
|
2539
2641
|
"additionalProperties": false
|
|
2540
2642
|
},
|
|
2541
|
-
"__@matchAll@
|
|
2643
|
+
"__@matchAll@6873": {
|
|
2542
2644
|
"type": "object",
|
|
2543
2645
|
"additionalProperties": false
|
|
2544
2646
|
}
|
|
@@ -9,7 +9,7 @@ import type { ApplicationConfigEntry } from '../../../../../../typings/configEnt
|
|
|
9
9
|
import type { SplitChunksOptions } from '../../../../types/webpack';
|
|
10
10
|
|
|
11
11
|
// based on [nextjs code](https://github.com/vercel/next.js/blob/aaeb349ce3e8c4c3435a43a29af4379266818e7b/packages/next/build/webpack-config.ts#L707)
|
|
12
|
-
const resolveFrameworksPaths = (rootDir: string, frameworksList: string[]) => {
|
|
12
|
+
export const resolveFrameworksPaths = (rootDir: string, frameworksList: string[]) => {
|
|
13
13
|
const topLevelFrameworkPaths: string[] = [];
|
|
14
14
|
const visitedFrameworkPackages = new Set<string>();
|
|
15
15
|
|
|
@@ -56,6 +56,10 @@ export const webpackServerConfig = ({
|
|
|
56
56
|
} else {
|
|
57
57
|
config.plugin('terser').use(TerserPlugin, [
|
|
58
58
|
{
|
|
59
|
+
minify:
|
|
60
|
+
configManager.experiments.minifier === 'swc'
|
|
61
|
+
? TerserPlugin.swcMinify
|
|
62
|
+
: TerserPlugin.terserMinify,
|
|
59
63
|
extractComments: false,
|
|
60
64
|
terserOptions: {
|
|
61
65
|
ecma: 5, // на сервере в страницу встраивается код, который может подключаться через import и terser его соптимизирует в es6
|
|
@@ -50,6 +50,10 @@ export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config
|
|
|
50
50
|
config.plugin('terser').use(TerserPlugin, [
|
|
51
51
|
{
|
|
52
52
|
extractComments: false,
|
|
53
|
+
minify:
|
|
54
|
+
configManager.experiments.minifier === 'swc'
|
|
55
|
+
? TerserPlugin.swcMinify
|
|
56
|
+
: TerserPlugin.terserMinify,
|
|
53
57
|
parallel: terser.parallel,
|
|
54
58
|
terserOptions: {
|
|
55
59
|
...tramvaiReactProfileTerserOptions,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type Config from 'webpack-chain';
|
|
2
2
|
import { ChunkCorrelationPlugin } from '@module-federation/node';
|
|
3
|
+
import LoadablePlugin from '@loadable/webpack-plugin';
|
|
3
4
|
|
|
4
5
|
import type { ConfigManager } from '../../../../config/configManager';
|
|
5
6
|
|
|
@@ -33,5 +34,12 @@ export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: C
|
|
|
33
34
|
},
|
|
34
35
|
]);
|
|
35
36
|
|
|
37
|
+
config.plugin('loadable-stats-plugin').use(LoadablePlugin, [
|
|
38
|
+
{
|
|
39
|
+
writeToDisk: true,
|
|
40
|
+
filename: `${name}_stats_loadable@${version}.json`,
|
|
41
|
+
},
|
|
42
|
+
]);
|
|
43
|
+
|
|
36
44
|
config.batch(files(configManager)).batch(nodeClient(configManager));
|
|
37
45
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type Config from 'webpack-chain';
|
|
2
|
+
import type webpack from 'webpack';
|
|
2
3
|
import path from 'path';
|
|
4
|
+
import crypto from 'crypto';
|
|
3
5
|
import { UniversalFederationPlugin } from '@module-federation/node';
|
|
4
6
|
import common from '../common/main';
|
|
5
7
|
|
|
@@ -9,7 +11,7 @@ import ts from '../blocks/ts';
|
|
|
9
11
|
import js from '../blocks/js';
|
|
10
12
|
import css from '../blocks/css';
|
|
11
13
|
import nodeClient from '../blocks/nodeClient';
|
|
12
|
-
import type { UniversalFederationPluginOptions } from '../types/webpack';
|
|
14
|
+
import type { SplitChunksOptions, UniversalFederationPluginOptions } from '../types/webpack';
|
|
13
15
|
import { getSharedModules } from './moduleFederationShared';
|
|
14
16
|
import { configToEnv } from '../blocks/configToEnv';
|
|
15
17
|
import sourcemaps from '../blocks/sourcemaps';
|
|
@@ -17,15 +19,20 @@ import type { ChildAppConfigEntry } from '../../../typings/configEntry/child-app
|
|
|
17
19
|
import { extractCssPluginFactory } from '../blocks/extractCssPlugin';
|
|
18
20
|
import type { ModuleFederationFixRangeOptions } from '../plugins/ModuleFederationFixRange';
|
|
19
21
|
import { ModuleFederationFixRange } from '../plugins/ModuleFederationFixRange';
|
|
22
|
+
import { resolveFrameworksPaths } from '../application/client/prod/optimization/splitChunks';
|
|
20
23
|
|
|
24
|
+
// eslint-disable-next-line max-statements
|
|
21
25
|
export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: Config) => {
|
|
22
|
-
const { name, root, sourceMap, buildType, shared } =
|
|
26
|
+
const { name, root, rootDir, sourceMap, buildType, shared, env, hotRefresh, target } =
|
|
27
|
+
configManager;
|
|
23
28
|
|
|
24
29
|
const cssLocalIdentName =
|
|
25
30
|
configManager.env === 'production'
|
|
26
31
|
? `${name}__[minicss]`
|
|
27
32
|
: `${name}__[name]__[local]_[hash:base64:5]`;
|
|
28
|
-
const entry = path.resolve(configManager.rootDir, root);
|
|
33
|
+
const entry = path.resolve(configManager.rootDir, root, 'index.ts');
|
|
34
|
+
|
|
35
|
+
const sharedModules = getSharedModules(configManager);
|
|
29
36
|
|
|
30
37
|
// use empty module instead of original one as I haven't figured out how to prevent webpack from initializing entry module on loading
|
|
31
38
|
// it should be initialized only as remote in ModuleFederation and not as standalone module
|
|
@@ -60,7 +67,7 @@ export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: C
|
|
|
60
67
|
config.optimization.set('chunkIds', 'named');
|
|
61
68
|
|
|
62
69
|
// define split chunks to put all of the css into single entry file
|
|
63
|
-
|
|
70
|
+
const webpackSplitChunks: SplitChunksOptions = {
|
|
64
71
|
cacheGroups: {
|
|
65
72
|
default: false,
|
|
66
73
|
defaultVendors: false,
|
|
@@ -69,9 +76,62 @@ export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: C
|
|
|
69
76
|
type: 'css/mini-extract',
|
|
70
77
|
chunks: 'async',
|
|
71
78
|
enforce: true,
|
|
79
|
+
priority: 50,
|
|
72
80
|
},
|
|
73
81
|
},
|
|
74
|
-
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// granular code splitting only for client builds
|
|
85
|
+
if (target !== 'node') {
|
|
86
|
+
// get resolved paths for shared modules and their dependencies
|
|
87
|
+
const sharedModulesPaths = resolveFrameworksPaths(
|
|
88
|
+
path.resolve(rootDir, root),
|
|
89
|
+
Object.keys(sharedModules)
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const granular: Record<string, any> = {
|
|
93
|
+
// we don't want to include MF shared deps
|
|
94
|
+
test(mod: webpack.Module) {
|
|
95
|
+
const resource = mod.nameForCondition && mod.nameForCondition();
|
|
96
|
+
|
|
97
|
+
if (!resource) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return sharedModulesPaths.every((packagePath) => !resource.startsWith(packagePath));
|
|
102
|
+
},
|
|
103
|
+
chunks: 'async',
|
|
104
|
+
// in some cases this group has priority over styles group, idk why, so decide to specify modules type explicitly
|
|
105
|
+
type: 'javascript/auto',
|
|
106
|
+
minChunks: 2,
|
|
107
|
+
minSize: 20000,
|
|
108
|
+
reuseExistingChunk: true,
|
|
109
|
+
maxInitialRequests: 10,
|
|
110
|
+
maxAsyncRequests: 20,
|
|
111
|
+
priority: 20,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// too slow for development, default names is fast, but have one problem -
|
|
115
|
+
// we can find shared chunk filenames only in `chunks` stats property, not in `assetsByChunkName`
|
|
116
|
+
// https://github.com/webpack/webpack/issues/14433#issuecomment-938468513
|
|
117
|
+
if (env === 'production') {
|
|
118
|
+
granular.name = (module: webpack.Module, chunks: webpack.Chunk[] = []) => {
|
|
119
|
+
return crypto
|
|
120
|
+
.createHash('sha1')
|
|
121
|
+
.update(
|
|
122
|
+
chunks.reduce((acc: string, chunk: webpack.Chunk) => {
|
|
123
|
+
return acc + chunk.name;
|
|
124
|
+
}, '')
|
|
125
|
+
)
|
|
126
|
+
.digest('hex')
|
|
127
|
+
.substring(0, 16);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
webpackSplitChunks.cacheGroups.granular = granular;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
config.optimization.splitChunks(webpackSplitChunks);
|
|
75
135
|
|
|
76
136
|
config.plugin('module-federation').use(UniversalFederationPlugin, [
|
|
77
137
|
{
|
|
@@ -100,7 +160,7 @@ export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: C
|
|
|
100
160
|
.split(path.win32.sep)
|
|
101
161
|
.join(path.posix.sep),
|
|
102
162
|
},
|
|
103
|
-
shared:
|
|
163
|
+
shared: sharedModules,
|
|
104
164
|
} as UniversalFederationPluginOptions,
|
|
105
165
|
]);
|
|
106
166
|
|
|
@@ -166,7 +166,8 @@ export class ModuleFederationFixRange implements webpack.WebpackPluginInstance {
|
|
|
166
166
|
if (requiredVersion && this.flexibleTramvaiVersions) {
|
|
167
167
|
const isTramvai = isUnifiedVersion(name) || isDependantLib(name);
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
// exclude local stub versions, because `^0.0.0-stub` will have lowest priority and unexpected versions can be used
|
|
170
|
+
if (isTramvai && requiredVersion[0] > 2 && resolvedVersion !== '0.0.0-stub') {
|
|
170
171
|
// 1 is used for `^` range modifier
|
|
171
172
|
// see https://github.com/webpack/webpack/blob/56363993156e06a1230c9759eba277a22e6b6604/lib/util/semver.js#LL235C20-L235C20
|
|
172
173
|
requiredVersion[0] = 1;
|
|
@@ -41,6 +41,7 @@ it('should populate defaults for config', () => {
|
|
|
41
41
|
"minicss": {
|
|
42
42
|
"useImportModule": true,
|
|
43
43
|
},
|
|
44
|
+
"minifier": "terser",
|
|
44
45
|
"pwa": {
|
|
45
46
|
"icon": {
|
|
46
47
|
"dest": "pwa-icons",
|
|
@@ -140,6 +141,7 @@ it('should populate defaults for config', () => {
|
|
|
140
141
|
"minicss": {
|
|
141
142
|
"useImportModule": true,
|
|
142
143
|
},
|
|
144
|
+
"minifier": "terser",
|
|
143
145
|
"transpilation": {
|
|
144
146
|
"loader": "babel",
|
|
145
147
|
},
|
|
@@ -278,6 +280,7 @@ it('should populate defaults for overridable options', () => {
|
|
|
278
280
|
"minicss": {
|
|
279
281
|
"useImportModule": true,
|
|
280
282
|
},
|
|
283
|
+
"minifier": "terser",
|
|
281
284
|
"pwa": {
|
|
282
285
|
"icon": {
|
|
283
286
|
"dest": "pwa-icons",
|
|
@@ -395,6 +398,7 @@ it('should populate defaults for overridable options', () => {
|
|
|
395
398
|
"minicss": {
|
|
396
399
|
"useImportModule": true,
|
|
397
400
|
},
|
|
401
|
+
"minifier": "terser",
|
|
398
402
|
"transpilation": {
|
|
399
403
|
"loader": {
|
|
400
404
|
"development": "babel",
|
|
@@ -896,6 +896,40 @@
|
|
|
896
896
|
}
|
|
897
897
|
},
|
|
898
898
|
"additionalProperties": false
|
|
899
|
+
},
|
|
900
|
+
"minifier": {
|
|
901
|
+
"cli_overridable": "",
|
|
902
|
+
"title": "specify minifer for terser plugin",
|
|
903
|
+
"default": "terser",
|
|
904
|
+
"anyOf": [
|
|
905
|
+
{
|
|
906
|
+
"type": "object",
|
|
907
|
+
"properties": {
|
|
908
|
+
"development": {
|
|
909
|
+
"enum": [
|
|
910
|
+
"swc",
|
|
911
|
+
"terser"
|
|
912
|
+
],
|
|
913
|
+
"type": "string"
|
|
914
|
+
},
|
|
915
|
+
"production": {
|
|
916
|
+
"enum": [
|
|
917
|
+
"swc",
|
|
918
|
+
"terser"
|
|
919
|
+
],
|
|
920
|
+
"type": "string"
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
"additionalProperties": false
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"enum": [
|
|
927
|
+
"swc",
|
|
928
|
+
"terser"
|
|
929
|
+
],
|
|
930
|
+
"type": "string"
|
|
931
|
+
}
|
|
932
|
+
]
|
|
899
933
|
}
|
|
900
934
|
},
|
|
901
935
|
"additionalProperties": false
|
|
@@ -1144,23 +1178,23 @@
|
|
|
1144
1178
|
"dotAll": {
|
|
1145
1179
|
"type": "boolean"
|
|
1146
1180
|
},
|
|
1147
|
-
"__@match@
|
|
1181
|
+
"__@match@6864": {
|
|
1148
1182
|
"type": "object",
|
|
1149
1183
|
"additionalProperties": false
|
|
1150
1184
|
},
|
|
1151
|
-
"__@replace@
|
|
1185
|
+
"__@replace@6866": {
|
|
1152
1186
|
"type": "object",
|
|
1153
1187
|
"additionalProperties": false
|
|
1154
1188
|
},
|
|
1155
|
-
"__@search@
|
|
1189
|
+
"__@search@6869": {
|
|
1156
1190
|
"type": "object",
|
|
1157
1191
|
"additionalProperties": false
|
|
1158
1192
|
},
|
|
1159
|
-
"__@split@
|
|
1193
|
+
"__@split@6871": {
|
|
1160
1194
|
"type": "object",
|
|
1161
1195
|
"additionalProperties": false
|
|
1162
1196
|
},
|
|
1163
|
-
"__@matchAll@
|
|
1197
|
+
"__@matchAll@6873": {
|
|
1164
1198
|
"type": "object",
|
|
1165
1199
|
"additionalProperties": false
|
|
1166
1200
|
}
|
|
@@ -1627,6 +1661,40 @@
|
|
|
1627
1661
|
}
|
|
1628
1662
|
},
|
|
1629
1663
|
"additionalProperties": false
|
|
1664
|
+
},
|
|
1665
|
+
"minifier": {
|
|
1666
|
+
"cli_overridable": "",
|
|
1667
|
+
"title": "specify minifer for terser plugin",
|
|
1668
|
+
"default": "terser",
|
|
1669
|
+
"anyOf": [
|
|
1670
|
+
{
|
|
1671
|
+
"type": "object",
|
|
1672
|
+
"properties": {
|
|
1673
|
+
"development": {
|
|
1674
|
+
"enum": [
|
|
1675
|
+
"swc",
|
|
1676
|
+
"terser"
|
|
1677
|
+
],
|
|
1678
|
+
"type": "string"
|
|
1679
|
+
},
|
|
1680
|
+
"production": {
|
|
1681
|
+
"enum": [
|
|
1682
|
+
"swc",
|
|
1683
|
+
"terser"
|
|
1684
|
+
],
|
|
1685
|
+
"type": "string"
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1688
|
+
"additionalProperties": false
|
|
1689
|
+
},
|
|
1690
|
+
{
|
|
1691
|
+
"enum": [
|
|
1692
|
+
"swc",
|
|
1693
|
+
"terser"
|
|
1694
|
+
],
|
|
1695
|
+
"type": "string"
|
|
1696
|
+
}
|
|
1697
|
+
]
|
|
1630
1698
|
}
|
|
1631
1699
|
},
|
|
1632
1700
|
"additionalProperties": false
|
|
@@ -1813,23 +1881,23 @@
|
|
|
1813
1881
|
"dotAll": {
|
|
1814
1882
|
"type": "boolean"
|
|
1815
1883
|
},
|
|
1816
|
-
"__@match@
|
|
1884
|
+
"__@match@6864": {
|
|
1817
1885
|
"type": "object",
|
|
1818
1886
|
"additionalProperties": false
|
|
1819
1887
|
},
|
|
1820
|
-
"__@replace@
|
|
1888
|
+
"__@replace@6866": {
|
|
1821
1889
|
"type": "object",
|
|
1822
1890
|
"additionalProperties": false
|
|
1823
1891
|
},
|
|
1824
|
-
"__@search@
|
|
1892
|
+
"__@search@6869": {
|
|
1825
1893
|
"type": "object",
|
|
1826
1894
|
"additionalProperties": false
|
|
1827
1895
|
},
|
|
1828
|
-
"__@split@
|
|
1896
|
+
"__@split@6871": {
|
|
1829
1897
|
"type": "object",
|
|
1830
1898
|
"additionalProperties": false
|
|
1831
1899
|
},
|
|
1832
|
-
"__@matchAll@
|
|
1900
|
+
"__@matchAll@6873": {
|
|
1833
1901
|
"type": "object",
|
|
1834
1902
|
"additionalProperties": false
|
|
1835
1903
|
}
|
|
@@ -2296,6 +2364,40 @@
|
|
|
2296
2364
|
}
|
|
2297
2365
|
},
|
|
2298
2366
|
"additionalProperties": false
|
|
2367
|
+
},
|
|
2368
|
+
"minifier": {
|
|
2369
|
+
"cli_overridable": "",
|
|
2370
|
+
"title": "specify minifer for terser plugin",
|
|
2371
|
+
"default": "terser",
|
|
2372
|
+
"anyOf": [
|
|
2373
|
+
{
|
|
2374
|
+
"type": "object",
|
|
2375
|
+
"properties": {
|
|
2376
|
+
"development": {
|
|
2377
|
+
"enum": [
|
|
2378
|
+
"swc",
|
|
2379
|
+
"terser"
|
|
2380
|
+
],
|
|
2381
|
+
"type": "string"
|
|
2382
|
+
},
|
|
2383
|
+
"production": {
|
|
2384
|
+
"enum": [
|
|
2385
|
+
"swc",
|
|
2386
|
+
"terser"
|
|
2387
|
+
],
|
|
2388
|
+
"type": "string"
|
|
2389
|
+
}
|
|
2390
|
+
},
|
|
2391
|
+
"additionalProperties": false
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
"enum": [
|
|
2395
|
+
"swc",
|
|
2396
|
+
"terser"
|
|
2397
|
+
],
|
|
2398
|
+
"type": "string"
|
|
2399
|
+
}
|
|
2400
|
+
]
|
|
2299
2401
|
}
|
|
2300
2402
|
},
|
|
2301
2403
|
"additionalProperties": false
|
|
@@ -2482,23 +2584,23 @@
|
|
|
2482
2584
|
"dotAll": {
|
|
2483
2585
|
"type": "boolean"
|
|
2484
2586
|
},
|
|
2485
|
-
"__@match@
|
|
2587
|
+
"__@match@6864": {
|
|
2486
2588
|
"type": "object",
|
|
2487
2589
|
"additionalProperties": false
|
|
2488
2590
|
},
|
|
2489
|
-
"__@replace@
|
|
2591
|
+
"__@replace@6866": {
|
|
2490
2592
|
"type": "object",
|
|
2491
2593
|
"additionalProperties": false
|
|
2492
2594
|
},
|
|
2493
|
-
"__@search@
|
|
2595
|
+
"__@search@6869": {
|
|
2494
2596
|
"type": "object",
|
|
2495
2597
|
"additionalProperties": false
|
|
2496
2598
|
},
|
|
2497
|
-
"__@split@
|
|
2599
|
+
"__@split@6871": {
|
|
2498
2600
|
"type": "object",
|
|
2499
2601
|
"additionalProperties": false
|
|
2500
2602
|
},
|
|
2501
|
-
"__@matchAll@
|
|
2603
|
+
"__@matchAll@6873": {
|
|
2502
2604
|
"type": "object",
|
|
2503
2605
|
"additionalProperties": false
|
|
2504
2606
|
}
|