@tramvai/cli 2.74.0 → 2.76.2
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/common/client/prod.js +19 -1
- package/lib/library/webpack/common/client/prod.js.map +1 -1
- package/lib/library/webpack/common/server/prod.js +7 -1
- package/lib/library/webpack/common/server/prod.js.map +1 -1
- package/package.json +3 -3
- package/src/library/webpack/common/client/prod.ts +21 -7
- package/src/library/webpack/common/server/prod.ts +9 -7
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const once_1 = tslib_1.__importDefault(require("@tinkoff/utils/function/once"));
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
3
6
|
const plugin_1 = require("inspectpack/plugin");
|
|
4
7
|
const webpack_dedupe_plugin_1 = require("@tinkoff/webpack-dedupe-plugin");
|
|
8
|
+
const onDedupeInfo = (0, once_1.default)((logInfo) => {
|
|
9
|
+
if (logInfo.size > 0) {
|
|
10
|
+
console.warn(`${chalk_1.default.blue('Duplicates were found and merged during build.')}
|
|
11
|
+
You may want to additionally optimize your dependencies tree to bypass possible issues with duplicates.
|
|
12
|
+
For further details refer to doc - https://tramvai.dev/docs/mistakes/duplicate-dependencies
|
|
13
|
+
`);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
5
16
|
exports.default = (configManager) => (config) => {
|
|
6
17
|
var _a;
|
|
7
18
|
config.mode('production');
|
|
@@ -9,7 +20,14 @@ exports.default = (configManager) => (config) => {
|
|
|
9
20
|
Object.assign(Object.assign({}, args[0]), { 'process.env.NODE_ENV': JSON.stringify('production') }),
|
|
10
21
|
]);
|
|
11
22
|
if (configManager.dedupe.enabled) {
|
|
12
|
-
config.plugin('dedupe-plugin').use(
|
|
23
|
+
config.plugin('dedupe-plugin').use(webpack_dedupe_plugin_1.DedupePlugin, [
|
|
24
|
+
{
|
|
25
|
+
strategy: configManager.dedupe.strategy,
|
|
26
|
+
ignorePackages: (_a = configManager.dedupe.ignore) === null || _a === void 0 ? void 0 : _a.map((ignore) => new RegExp(`^${ignore}`)),
|
|
27
|
+
showLogs: !configManager.modern,
|
|
28
|
+
onDedupeInfo,
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
13
31
|
}
|
|
14
32
|
else {
|
|
15
33
|
config.plugin('duplicates-plugin').use(plugin_1.DuplicatesPlugin, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prod.js","sourceRoot":"","sources":["../../../../../src/library/webpack/common/client/prod.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prod.js","sourceRoot":"","sources":["../../../../../src/library/webpack/common/client/prod.ts"],"names":[],"mappings":";;;AAAA,gFAAgD;AAEhD,0DAA0B;AAC1B,+CAAsD;AAEtD,0EAA8D;AAI9D,MAAM,YAAY,GAAG,IAAA,cAAI,EAAsC,CAAC,OAAO,EAAE,EAAE;IACzE,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE;QACpB,OAAO,CAAC,IAAI,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC;;;KAG3E,CAAC,CAAC;KACJ;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,CAAC,aAA4C,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE;;IAClF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE1B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;wCAE/B,IAAI,CAAC,CAAC,CAAC,KACV,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAEvD,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE;QAChC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,oCAAY,EAAE;YAC/C;gBACE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ;gBACvC,cAAc,EAAE,MAAA,aAAa,CAAC,MAAM,CAAC,MAAM,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;gBACtF,QAAQ,EAAE,CAAC,aAAa,CAAC,MAAM;gBAC/B,YAAY;aACU;SACzB,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,yBAAgB,EAAE;YACvD;gBACE,OAAO,EAAE,IAAI;gBACb,+BAA+B;gBAC/B,+EAA+E;gBAC/E,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE;oBAC9B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvB,CAAC;aACF;SACF,CAAC,CAAC;KACJ;AACH,CAAC,CAAC"}
|
|
@@ -8,7 +8,13 @@ exports.default = (configManager) => (config) => {
|
|
|
8
8
|
Object.assign(Object.assign({}, args[0]), { 'process.env.NODE_ENV': JSON.stringify('production') }),
|
|
9
9
|
]);
|
|
10
10
|
if (configManager.dedupe.enabled) {
|
|
11
|
-
config.plugin('dedupe-plugin').use(
|
|
11
|
+
config.plugin('dedupe-plugin').use(webpack_dedupe_plugin_1.DedupePlugin, [
|
|
12
|
+
{
|
|
13
|
+
strategy: configManager.dedupe.strategy,
|
|
14
|
+
showLogs: false,
|
|
15
|
+
ignorePackages: (_a = configManager.dedupe.ignore) === null || _a === void 0 ? void 0 : _a.map((ignore) => new RegExp(`^${ignore}`)),
|
|
16
|
+
},
|
|
17
|
+
]);
|
|
12
18
|
}
|
|
13
19
|
};
|
|
14
20
|
//# sourceMappingURL=prod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prod.js","sourceRoot":"","sources":["../../../../../src/library/webpack/common/server/prod.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"prod.js","sourceRoot":"","sources":["../../../../../src/library/webpack/common/server/prod.ts"],"names":[],"mappings":";;AAEA,0EAA8D;AAI9D,kBAAe,CAAC,aAA4C,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE;;IAClF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE1B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;wCAE/B,IAAI,CAAC,CAAC,CAAC,KACV,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAEvD,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE;QAChC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,oCAAY,EAAE;YAC/C;gBACE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ;gBACvC,QAAQ,EAAE,KAAK;gBACf,cAAc,EAAE,MAAA,aAAa,CAAC,MAAM,CAAC,MAAM,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;aAChE;SACzB,CAAC,CAAC;KACJ;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.76.2",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@tinkoff/request-core": "^0.9.2",
|
|
69
69
|
"@tinkoff/request-plugin-protocol-http": "^0.11.6",
|
|
70
70
|
"@tinkoff/utils": "^2.1.3",
|
|
71
|
-
"@tinkoff/webpack-dedupe-plugin": "1.0.
|
|
71
|
+
"@tinkoff/webpack-dedupe-plugin": "1.0.3",
|
|
72
72
|
"@tramvai/build": "3.1.2",
|
|
73
|
-
"@tramvai/react": "2.
|
|
73
|
+
"@tramvai/react": "2.76.2",
|
|
74
74
|
"@tramvai/tools-check-versions": "0.4.9",
|
|
75
75
|
"@tramvai/tools-migrate": "0.6.12",
|
|
76
76
|
"ajv": "^6.12.6",
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import once from '@tinkoff/utils/function/once';
|
|
1
2
|
import type Config from 'webpack-chain';
|
|
3
|
+
import chalk from 'chalk';
|
|
2
4
|
import { DuplicatesPlugin } from 'inspectpack/plugin';
|
|
3
|
-
import {
|
|
5
|
+
import type { DedupePluginOptions } from '@tinkoff/webpack-dedupe-plugin';
|
|
6
|
+
import { DedupePlugin } from '@tinkoff/webpack-dedupe-plugin';
|
|
4
7
|
import type { ConfigManager } from '../../../../config/configManager';
|
|
5
8
|
import type { CliConfigEntry } from '../../../../typings/configEntry/cli';
|
|
6
9
|
|
|
10
|
+
const onDedupeInfo = once<DedupePluginOptions['onDedupeInfo']>((logInfo) => {
|
|
11
|
+
if (logInfo.size > 0) {
|
|
12
|
+
console.warn(`${chalk.blue('Duplicates were found and merged during build.')}
|
|
13
|
+
You may want to additionally optimize your dependencies tree to bypass possible issues with duplicates.
|
|
14
|
+
For further details refer to doc - https://tramvai.dev/docs/mistakes/duplicate-dependencies
|
|
15
|
+
`);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
7
19
|
export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config) => {
|
|
8
20
|
config.mode('production');
|
|
9
21
|
|
|
@@ -15,12 +27,14 @@ export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config
|
|
|
15
27
|
]);
|
|
16
28
|
|
|
17
29
|
if (configManager.dedupe.enabled) {
|
|
18
|
-
config.plugin('dedupe-plugin').use(
|
|
19
|
-
|
|
20
|
-
configManager.dedupe.strategy,
|
|
21
|
-
configManager.dedupe.ignore?.map((ignore) => new RegExp(`^${ignore}`))
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
config.plugin('dedupe-plugin').use(DedupePlugin, [
|
|
31
|
+
{
|
|
32
|
+
strategy: configManager.dedupe.strategy,
|
|
33
|
+
ignorePackages: configManager.dedupe.ignore?.map((ignore) => new RegExp(`^${ignore}`)),
|
|
34
|
+
showLogs: !configManager.modern,
|
|
35
|
+
onDedupeInfo,
|
|
36
|
+
} as DedupePluginOptions,
|
|
37
|
+
]);
|
|
24
38
|
} else {
|
|
25
39
|
config.plugin('duplicates-plugin').use(DuplicatesPlugin, [
|
|
26
40
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type Config from 'webpack-chain';
|
|
2
|
-
import {
|
|
2
|
+
import type { DedupePluginOptions } from '@tinkoff/webpack-dedupe-plugin';
|
|
3
|
+
import { DedupePlugin } from '@tinkoff/webpack-dedupe-plugin';
|
|
3
4
|
import type { ConfigManager } from '../../../../config/configManager';
|
|
4
5
|
import type { CliConfigEntry } from '../../../../typings/configEntry/cli';
|
|
5
6
|
|
|
@@ -14,11 +15,12 @@ export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config
|
|
|
14
15
|
]);
|
|
15
16
|
|
|
16
17
|
if (configManager.dedupe.enabled) {
|
|
17
|
-
config.plugin('dedupe-plugin').use(
|
|
18
|
-
|
|
19
|
-
configManager.dedupe.strategy,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
config.plugin('dedupe-plugin').use(DedupePlugin, [
|
|
19
|
+
{
|
|
20
|
+
strategy: configManager.dedupe.strategy,
|
|
21
|
+
showLogs: false,
|
|
22
|
+
ignorePackages: configManager.dedupe.ignore?.map((ignore) => new RegExp(`^${ignore}`)),
|
|
23
|
+
} as DedupePluginOptions,
|
|
24
|
+
]);
|
|
23
25
|
}
|
|
24
26
|
};
|