@tramvai/cli 7.4.3 → 7.5.0
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/api/analyze/index.d.ts +1 -1
- package/lib/api/analyze/index.d.ts.map +1 -1
- package/lib/api/start/index.d.ts +1 -1
- package/lib/api/start/index.d.ts.map +1 -1
- package/lib/builder/webpack/analyzePlugins/bundle.d.ts +1 -1
- package/lib/builder/webpack/analyzePlugins/bundle.js +1 -1
- package/lib/builder/webpack/analyzePlugins/bundle.js.map +1 -1
- package/lib/builder/webpack/analyzePlugins/rsdoctor.d.ts +0 -4
- package/lib/builder/webpack/analyzePlugins/rsdoctor.d.ts.map +1 -1
- package/lib/builder/webpack/analyzePlugins/rsdoctor.js +0 -1
- package/lib/builder/webpack/analyzePlugins/rsdoctor.js.map +1 -1
- package/lib/builder/webpack/analyzePlugins/statoscope.d.ts +3 -7
- package/lib/builder/webpack/analyzePlugins/statoscope.d.ts.map +1 -1
- package/lib/builder/webpack/analyzePlugins/statoscope.js +6 -26
- package/lib/builder/webpack/analyzePlugins/statoscope.js.map +1 -1
- package/lib/builder/webpack/analyzePlugins/stats.d.ts +12 -0
- package/lib/builder/webpack/analyzePlugins/stats.d.ts.map +1 -0
- package/lib/builder/webpack/analyzePlugins/stats.js +40 -0
- package/lib/builder/webpack/analyzePlugins/stats.js.map +1 -0
- package/lib/builder/webpack/analyzePlugins/whyBundled.d.ts +1 -1
- package/lib/builder/webpack/analyzePlugins/whyBundled.d.ts.map +1 -1
- package/lib/builder/webpack/analyzePlugins/whyBundled.js +1 -1
- package/lib/builder/webpack/analyzePlugins/whyBundled.js.map +1 -1
- package/lib/builder/webpack/providers/build/server.d.ts.map +1 -1
- package/lib/builder/webpack/providers/build/server.js +5 -2
- package/lib/builder/webpack/providers/build/server.js.map +1 -1
- package/lib/builder/webpack/providers/shared.d.ts.map +1 -1
- package/lib/builder/webpack/providers/shared.js +2 -0
- package/lib/builder/webpack/providers/shared.js.map +1 -1
- package/lib/builder/webpack/providers/start/shared.d.ts.map +1 -1
- package/lib/builder/webpack/providers/start/shared.js +10 -4
- package/lib/builder/webpack/providers/start/shared.js.map +1 -1
- package/lib/builder/webpack/types.d.ts +2 -1
- package/lib/builder/webpack/types.d.ts.map +1 -1
- package/lib/builder/webpack/types.js +3 -1
- package/lib/builder/webpack/types.js.map +1 -1
- package/lib/commands/analyze/command.js +1 -1
- package/lib/commands/analyze/command.js.map +1 -1
- package/lib/commands/build/command.d.ts.map +1 -1
- package/lib/commands/build/command.js +6 -1
- package/lib/commands/build/command.js.map +1 -1
- package/lib/commands/start/command.js +1 -1
- package/lib/commands/start/command.js.map +1 -1
- package/lib/config/configManager.d.ts +2 -1
- package/lib/config/configManager.d.ts.map +1 -1
- package/lib/config/configManager.js +1 -0
- package/lib/config/configManager.js.map +1 -1
- package/lib/library/webpack/blocks/optimize.d.ts.map +1 -1
- package/lib/library/webpack/blocks/optimize.js +7 -1
- package/lib/library/webpack/blocks/optimize.js.map +1 -1
- package/lib/library/webpack/child-app/common.d.ts.map +1 -1
- package/lib/library/webpack/child-app/common.js +2 -10
- package/lib/library/webpack/child-app/common.js.map +1 -1
- package/lib/library/webpack/common/main.js +1 -1
- package/lib/library/webpack/common/main.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +15 -15
- package/package.json +8 -7
- package/schema.json +15 -15
- package/src/api/analyze/index.ts +1 -1
- package/src/api/build/__integration__/build.test.ts +8 -8
- package/src/api/start/index.ts +1 -1
- package/src/builder/webpack/analyzePlugins/bundle.ts +1 -1
- package/src/builder/webpack/analyzePlugins/rsdoctor.ts +0 -2
- package/src/builder/webpack/analyzePlugins/statoscope.ts +8 -40
- package/src/builder/webpack/analyzePlugins/stats.ts +45 -0
- package/src/builder/webpack/analyzePlugins/whyBundled.ts +1 -1
- package/src/builder/webpack/providers/build/server.ts +7 -2
- package/src/builder/webpack/providers/shared.ts +2 -0
- package/src/builder/webpack/providers/start/shared.ts +10 -4
- package/src/builder/webpack/types.ts +5 -2
- package/src/commands/analyze/command.ts +1 -1
- package/src/commands/build/command.ts +6 -1
- package/src/commands/start/command.ts +1 -1
- package/src/config/configManager.ts +3 -1
- package/src/library/swc/__integration__/__snapshots__/swc.build.test.ts.snap +14 -14
- package/src/library/swc/__integration__/__snapshots__/swc.start.test.ts.snap +30 -30
- package/src/library/swc/__integration__/swc.build.test.ts +1 -1
- package/src/library/swc/__integration__/swc.start.test.ts +1 -1
- package/src/library/webpack/blocks/optimize.ts +8 -1
- package/src/library/webpack/child-app/common.ts +2 -10
- package/src/library/webpack/common/main.ts +1 -1
- package/src/schema/autogeneratedSchema.json +15 -15
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type Config from 'webpack-chain';
|
|
2
|
+
import { Configuration } from 'webpack';
|
|
3
|
+
|
|
2
4
|
import type { ConfigManager } from '../../config/configManager';
|
|
3
5
|
|
|
4
6
|
export type ConfigGenerator = (arg: {
|
|
@@ -9,7 +11,7 @@ export type ConfigGenerator = (arg: {
|
|
|
9
11
|
export abstract class AnalyzePlugin {
|
|
10
12
|
requireDeps?: string[];
|
|
11
13
|
|
|
12
|
-
protected options
|
|
14
|
+
protected options?: (webpackConfig: Configuration) => any[] = () => [];
|
|
13
15
|
|
|
14
16
|
protected abstract plugin;
|
|
15
17
|
|
|
@@ -24,7 +26,8 @@ export abstract class AnalyzePlugin {
|
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
protected patchConfigInternal(config: Config): Config {
|
|
27
|
-
config.
|
|
29
|
+
const pureWebpackConfig = config.toConfig();
|
|
30
|
+
config.plugin('analyze').use(this.plugin, this.options(pureWebpackConfig));
|
|
28
31
|
|
|
29
32
|
return config;
|
|
30
33
|
}
|
|
@@ -17,7 +17,7 @@ class AnalyzeCommand extends CLICommand<Params> {
|
|
|
17
17
|
{
|
|
18
18
|
name: '-p, --plugin',
|
|
19
19
|
value: '[plugin]',
|
|
20
|
-
description: 'Analysis plugin type <bundle|whybundled|statoscope|rsdoctor>',
|
|
20
|
+
description: 'Analysis plugin type <bundle|whybundled|statoscope|rsdoctor|stats>',
|
|
21
21
|
defaultValue: 'bundle',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
@@ -32,6 +32,11 @@ class BuildCommand extends CLICommand<Params> {
|
|
|
32
32
|
value: '[disableProdOptimization]',
|
|
33
33
|
description: 'Disable optimization of bundle sizes for production (minification, etc.)',
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
name: '--readableOutput',
|
|
37
|
+
value: '[readableOutput]',
|
|
38
|
+
description: 'Disable hashed names and concatenated modules for better debug/analyze purpose',
|
|
39
|
+
},
|
|
35
40
|
{
|
|
36
41
|
name: '--showConfig',
|
|
37
42
|
value: '[showConfig]',
|
|
@@ -51,7 +56,7 @@ class BuildCommand extends CLICommand<Params> {
|
|
|
51
56
|
name: '--analyze',
|
|
52
57
|
value: '[analyze]',
|
|
53
58
|
description:
|
|
54
|
-
'Run build with analyze, supported plugins: <bundle|whybundled|statoscope|rsdoctor>',
|
|
59
|
+
'Run build with analyze, supported plugins: <bundle|whybundled|statoscope|rsdoctor|stats>',
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
name: '--fileCache',
|
|
@@ -92,7 +92,7 @@ export class StartCommand extends CLICommand<Params> {
|
|
|
92
92
|
name: '--analyze',
|
|
93
93
|
value: '[analyze]',
|
|
94
94
|
description:
|
|
95
|
-
'Run build with analyze, supported plugins: <bundle|whybundled|statoscope|rsdoctor>',
|
|
95
|
+
'Run build with analyze, supported plugins: <bundle|whybundled|statoscope|rsdoctor|stats>',
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
name: '--onlyBundles',
|
|
@@ -41,8 +41,9 @@ export interface Settings<E extends Env> {
|
|
|
41
41
|
resolveSymlinks?: boolean;
|
|
42
42
|
showConfig?: boolean;
|
|
43
43
|
onlyBundles?: string[];
|
|
44
|
-
analyze?: false | 'bundle' | 'whybundled' | 'statoscope' | 'rsdoctor';
|
|
44
|
+
analyze?: false | 'bundle' | 'whybundled' | 'statoscope' | 'rsdoctor' | 'stats';
|
|
45
45
|
disableProdOptimization?: boolean;
|
|
46
|
+
readableOutput?: boolean;
|
|
46
47
|
fileCache?: boolean;
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -136,6 +137,7 @@ export const createConfigManager = <C extends ConfigEntry = ConfigEntry, E exten
|
|
|
136
137
|
benchmark: false,
|
|
137
138
|
resolveSymlinks: true,
|
|
138
139
|
disableProdOptimization: false,
|
|
140
|
+
readableOutput: false,
|
|
139
141
|
analyze: false,
|
|
140
142
|
onlyBundles: [],
|
|
141
143
|
// according to measures fileCache in webpack doesn't affect
|
|
@@ -8,7 +8,7 @@ exports[`client: create-token-pure.ts 1`] = `
|
|
|
8
8
|
/* binding */ return TEST_TOKEN;
|
|
9
9
|
}
|
|
10
10
|
/* harmony export */ });
|
|
11
|
-
const TEST_TOKEN = /*#__PURE__*/ /*#__PURE__*/ (0, __webpack_require__("./
|
|
11
|
+
const TEST_TOKEN = /*#__PURE__*/ /*#__PURE__*/ (0, __webpack_require__("./mocks/tramvai-core.ts").E)("TEST_TOKEN");
|
|
12
12
|
"
|
|
13
13
|
`;
|
|
14
14
|
|
|
@@ -73,7 +73,7 @@ exports[`client: lazy-component.tsx 1`] = `
|
|
|
73
73
|
}
|
|
74
74
|
/* harmony export */ });
|
|
75
75
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime");
|
|
76
|
-
/* harmony import */ const LazyComponent = (0, __webpack_require__("./
|
|
76
|
+
/* harmony import */ const LazyComponent = (0, __webpack_require__("./mocks/tramvai-react.ts").R)({
|
|
77
77
|
chunkName: () => "components-lazy-inner",
|
|
78
78
|
requireSync(props) {
|
|
79
79
|
return __webpack_require__(this.resolve(props));
|
|
@@ -82,11 +82,11 @@ exports[`client: lazy-component.tsx 1`] = `
|
|
|
82
82
|
const key = this.resolve(props);
|
|
83
83
|
return !!__webpack_require__.m[key];
|
|
84
84
|
},
|
|
85
|
-
importAsync: () => __webpack_require__.e(/* import() | components-lazy-inner */ "components-lazy-inner").then(__webpack_require__.bind(__webpack_require__, "./
|
|
85
|
+
importAsync: () => __webpack_require__.e(/* import() | components-lazy-inner */ "components-lazy-inner").then(__webpack_require__.bind(__webpack_require__, "./components/lazy-inner.tsx")),
|
|
86
86
|
requireAsync(props) {
|
|
87
87
|
return this.importAsync(props).then(resolved => resolved);
|
|
88
88
|
},
|
|
89
|
-
resolve: () => /*require.resolve*/ "./
|
|
89
|
+
resolve: () => /*require.resolve*/ "./components/lazy-inner.tsx"
|
|
90
90
|
}), Component = () => /*#__PURE__*/ /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
91
91
|
children: [
|
|
92
92
|
/*#__PURE__*/
|
|
@@ -121,7 +121,7 @@ exports[`client: provider-stack.ts 1`] = `
|
|
|
121
121
|
/* binding */ return providers;
|
|
122
122
|
}
|
|
123
123
|
/* harmony export */ });
|
|
124
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
124
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts"), _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./create-token-pure.ts");
|
|
125
125
|
/* harmony import */ const providers = [ (0, _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ /* .provide */ .G)({
|
|
126
126
|
provide: _create_token_pure__WEBPACK_IMPORTED_MODULE_1__.TEST_TOKEN,
|
|
127
127
|
useValue: "test"
|
|
@@ -137,7 +137,7 @@ exports[`client: react-svg.tsx 1`] = `
|
|
|
137
137
|
/* binding */ return Component;
|
|
138
138
|
}
|
|
139
139
|
/* harmony export */ });
|
|
140
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
140
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./images/logo.svg?react");
|
|
141
141
|
/* harmony import */ const Component = () => /*#__PURE__*/ /*#__PURE__*/ (0,
|
|
142
142
|
react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
143
143
|
children: /*#__PURE__*/ /*#__PURE__*/ (0 /* ["default"] */ , react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__.A, {})
|
|
@@ -153,7 +153,7 @@ exports[`client: server.inline.ts 1`] = `
|
|
|
153
153
|
/* binding */ return ForBrowser;
|
|
154
154
|
}
|
|
155
155
|
/* harmony export */ });
|
|
156
|
-
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("
|
|
156
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../../../../../node_modules/@swc/helpers/esm/_define_property.js");
|
|
157
157
|
class ForBrowser {
|
|
158
158
|
test() {
|
|
159
159
|
console.log("Ok");
|
|
@@ -189,7 +189,7 @@ exports[`server: create-token-pure.ts 1`] = `
|
|
|
189
189
|
/* binding */ return TEST_TOKEN;
|
|
190
190
|
}
|
|
191
191
|
/* harmony export */ });
|
|
192
|
-
const TEST_TOKEN = /*#__PURE__*/ /*#__PURE__*/ (0, __webpack_require__("./
|
|
192
|
+
const TEST_TOKEN = /*#__PURE__*/ /*#__PURE__*/ (0, __webpack_require__("./mocks/tramvai-core.ts").E)("TEST_TOKEN");
|
|
193
193
|
"
|
|
194
194
|
`;
|
|
195
195
|
|
|
@@ -251,8 +251,8 @@ exports[`server: lazy-component.tsx 1`] = `
|
|
|
251
251
|
/* binding */ return Component;
|
|
252
252
|
}
|
|
253
253
|
/* harmony export */ });
|
|
254
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _swc_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("
|
|
255
|
-
/* harmony import */ const LazyComponent = (0, __webpack_require__("./
|
|
254
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _swc_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../../../../node_modules/@swc/helpers/esm/_interop_require_wildcard.js");
|
|
255
|
+
/* harmony import */ const LazyComponent = (0, __webpack_require__("./mocks/tramvai-react.ts").R)({
|
|
256
256
|
chunkName() {
|
|
257
257
|
return "components-lazy-inner";
|
|
258
258
|
},
|
|
@@ -263,13 +263,13 @@ exports[`server: lazy-component.tsx 1`] = `
|
|
|
263
263
|
const key = this.resolve(props);
|
|
264
264
|
return !!__webpack_require__.m[key];
|
|
265
265
|
},
|
|
266
|
-
importAsync: () => Promise.resolve().then(() => (0, _swc_helpers__WEBPACK_IMPORTED_MODULE_1__._)(__webpack_require__(/* webpackChunkName: "components-lazy-inner" */ "./
|
|
266
|
+
importAsync: () => Promise.resolve().then(() => (0, _swc_helpers__WEBPACK_IMPORTED_MODULE_1__._)(__webpack_require__(/* webpackChunkName: "components-lazy-inner" */ "./components/lazy-inner.tsx"))),
|
|
267
267
|
requireAsync(props) {
|
|
268
268
|
return this.importAsync(props).then(resolved => resolved);
|
|
269
269
|
},
|
|
270
270
|
resolve() {
|
|
271
271
|
/*require.resolve*/
|
|
272
|
-
return "./
|
|
272
|
+
return "./components/lazy-inner.tsx";
|
|
273
273
|
}
|
|
274
274
|
}), Component = () => /*#__PURE__*/ /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
275
275
|
children: [
|
|
@@ -303,7 +303,7 @@ exports[`server: provider-stack.ts 1`] = `
|
|
|
303
303
|
/* binding */ return providers;
|
|
304
304
|
}
|
|
305
305
|
/* harmony export */ });
|
|
306
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
306
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts"), _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./create-token-pure.ts");
|
|
307
307
|
/* harmony import */ const providers = [ (0, _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ /* .provide */ .G)({
|
|
308
308
|
provide: _create_token_pure__WEBPACK_IMPORTED_MODULE_1__.TEST_TOKEN,
|
|
309
309
|
useValue: "test"
|
|
@@ -318,7 +318,7 @@ exports[`server: react-svg.tsx 1`] = `
|
|
|
318
318
|
/* binding */ return Component;
|
|
319
319
|
}
|
|
320
320
|
/* harmony export */ });
|
|
321
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
321
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime"), _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./images/logo.svg?react");
|
|
322
322
|
/* harmony import */ const Component = () => /*#__PURE__*/ /*#__PURE__*/ (0,
|
|
323
323
|
react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
324
324
|
children: /*#__PURE__*/ /*#__PURE__*/ (0 /* ["default"] */ , react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__.A, {})
|
|
@@ -5,9 +5,9 @@ exports[`client: create-token-pure.ts 1`] = `
|
|
|
5
5
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6
6
|
/* harmony export */ TEST_TOKEN: function() { return /* binding */ TEST_TOKEN; }
|
|
7
7
|
/* harmony export */ });
|
|
8
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
9
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
10
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
8
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts");
|
|
9
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
10
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const TEST_TOKEN = /*#__PURE__*/ (0,_tramvai_core__WEBPACK_IMPORTED_MODULE_0__.createToken)('TEST_TOKEN');
|
|
@@ -139,9 +139,9 @@ exports[`client: lazy-component.tsx 1`] = `
|
|
|
139
139
|
/* harmony export */ });
|
|
140
140
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-dev-runtime/react/jsx-dev-runtime");
|
|
141
141
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
142
|
-
/* harmony import */ var _tramvai_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
143
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
144
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
142
|
+
/* harmony import */ var _tramvai_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./mocks/tramvai-react.ts");
|
|
143
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
144
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
@@ -156,12 +156,12 @@ const LazyComponent = (0,_tramvai_react__WEBPACK_IMPORTED_MODULE_1__.lazy)({
|
|
|
156
156
|
const key = this.resolve(props);
|
|
157
157
|
return !!__webpack_require__.m[key];
|
|
158
158
|
},
|
|
159
|
-
importAsync: ()=>__webpack_require__.e(/* import() | components-lazy-inner */ "components-lazy-inner").then(__webpack_require__.bind(__webpack_require__, "./
|
|
159
|
+
importAsync: ()=>__webpack_require__.e(/* import() | components-lazy-inner */ "components-lazy-inner").then(__webpack_require__.bind(__webpack_require__, "./components/lazy-inner.tsx")),
|
|
160
160
|
requireAsync (props) {
|
|
161
161
|
return this.importAsync(props).then((resolved)=>resolved);
|
|
162
162
|
},
|
|
163
163
|
resolve () {
|
|
164
|
-
return /*require.resolve*/("./
|
|
164
|
+
return /*require.resolve*/("./components/lazy-inner.tsx");
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
_c = LazyComponent;
|
|
@@ -228,8 +228,8 @@ exports[`client: node-env.ts 1`] = `
|
|
|
228
228
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
229
229
|
/* harmony export */ func: function() { return /* binding */ func; }
|
|
230
230
|
/* harmony export */ });
|
|
231
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
232
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
231
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
232
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
233
233
|
|
|
234
234
|
let internalFunc;
|
|
235
235
|
if (true) {
|
|
@@ -281,10 +281,10 @@ exports[`client: provider-stack.ts 1`] = `
|
|
|
281
281
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
282
282
|
/* harmony export */ providers: function() { return /* binding */ providers; }
|
|
283
283
|
/* harmony export */ });
|
|
284
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
285
|
-
/* harmony import */ var _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
286
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
287
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
284
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts");
|
|
285
|
+
/* harmony import */ var _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./create-token-pure.ts");
|
|
286
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
287
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
288
288
|
|
|
289
289
|
var _ref;
|
|
290
290
|
|
|
@@ -341,9 +341,9 @@ exports[`client: react-svg.tsx 1`] = `
|
|
|
341
341
|
/* harmony export */ });
|
|
342
342
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-dev-runtime/react/jsx-dev-runtime");
|
|
343
343
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
344
|
-
/* harmony import */ var _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
345
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
346
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
344
|
+
/* harmony import */ var _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./images/logo.svg?react");
|
|
345
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
346
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
|
|
@@ -404,9 +404,9 @@ exports[`client: server.inline.ts 1`] = `
|
|
|
404
404
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
405
405
|
/* harmony export */ ForBrowser: function() { return /* binding */ ForBrowser; }
|
|
406
406
|
/* harmony export */ });
|
|
407
|
-
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("
|
|
408
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
409
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
407
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../../../../../node_modules/@swc/helpers/esm/_define_property.js");
|
|
408
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
409
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
410
410
|
|
|
411
411
|
|
|
412
412
|
class ForBrowser {
|
|
@@ -461,8 +461,8 @@ exports[`client: typeof-window.ts 1`] = `
|
|
|
461
461
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
462
462
|
/* harmony export */ func: function() { return /* binding */ func; }
|
|
463
463
|
/* harmony export */ });
|
|
464
|
-
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("
|
|
465
|
-
__webpack_require__.$Refresh$.runtime = __webpack_require__("
|
|
464
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../../../../../node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
465
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../../../../../node_modules/react-refresh/runtime.js");
|
|
466
466
|
|
|
467
467
|
let internalFunc;
|
|
468
468
|
if (true) {
|
|
@@ -514,7 +514,7 @@ exports[`server: create-token-pure.ts 1`] = `
|
|
|
514
514
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
515
515
|
/* harmony export */ TEST_TOKEN: function() { return /* binding */ TEST_TOKEN; }
|
|
516
516
|
/* harmony export */ });
|
|
517
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
517
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts");
|
|
518
518
|
|
|
519
519
|
const TEST_TOKEN = /*#__PURE__*/ (0,_tramvai_core__WEBPACK_IMPORTED_MODULE_0__.createToken)('TEST_TOKEN');
|
|
520
520
|
|
|
@@ -611,8 +611,8 @@ exports[`server: lazy-component.tsx 1`] = `
|
|
|
611
611
|
/* harmony export */ });
|
|
612
612
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-dev-runtime/react/jsx-dev-runtime");
|
|
613
613
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
614
|
-
/* harmony import */ var _swc_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("
|
|
615
|
-
/* harmony import */ var _tramvai_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./
|
|
614
|
+
/* harmony import */ var _swc_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../../../../node_modules/@swc/helpers/esm/_interop_require_wildcard.js");
|
|
615
|
+
/* harmony import */ var _tramvai_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./mocks/tramvai-react.ts");
|
|
616
616
|
|
|
617
617
|
|
|
618
618
|
|
|
@@ -627,12 +627,12 @@ const LazyComponent = (0,_tramvai_react__WEBPACK_IMPORTED_MODULE_2__.lazy)({
|
|
|
627
627
|
const key = this.resolve(props);
|
|
628
628
|
return !!__webpack_require__.m[key];
|
|
629
629
|
},
|
|
630
|
-
importAsync: ()=>Promise.resolve().then(()=>(0,_swc_helpers__WEBPACK_IMPORTED_MODULE_1__._)(__webpack_require__(/* webpackChunkName: "components-lazy-inner" */ "./
|
|
630
|
+
importAsync: ()=>Promise.resolve().then(()=>(0,_swc_helpers__WEBPACK_IMPORTED_MODULE_1__._)(__webpack_require__(/* webpackChunkName: "components-lazy-inner" */ "./components/lazy-inner.tsx"))),
|
|
631
631
|
requireAsync (props) {
|
|
632
632
|
return this.importAsync(props).then((resolved)=>resolved);
|
|
633
633
|
},
|
|
634
634
|
resolve () {
|
|
635
|
-
return /*require.resolve*/("./
|
|
635
|
+
return /*require.resolve*/("./components/lazy-inner.tsx");
|
|
636
636
|
}
|
|
637
637
|
});
|
|
638
638
|
const Component = ()=>{
|
|
@@ -682,8 +682,8 @@ exports[`server: provider-stack.ts 1`] = `
|
|
|
682
682
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
683
683
|
/* harmony export */ providers: function() { return /* binding */ providers; }
|
|
684
684
|
/* harmony export */ });
|
|
685
|
-
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./
|
|
686
|
-
/* harmony import */ var _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
685
|
+
/* harmony import */ var _tramvai_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./mocks/tramvai-core.ts");
|
|
686
|
+
/* harmony import */ var _create_token_pure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./create-token-pure.ts");
|
|
687
687
|
var _ref;
|
|
688
688
|
|
|
689
689
|
|
|
@@ -708,7 +708,7 @@ exports[`server: react-svg.tsx 1`] = `
|
|
|
708
708
|
/* harmony export */ });
|
|
709
709
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-dev-runtime/react/jsx-dev-runtime");
|
|
710
710
|
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
711
|
-
/* harmony import */ var _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./
|
|
711
|
+
/* harmony import */ var _images_logo_svg_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./images/logo.svg?react");
|
|
712
712
|
|
|
713
713
|
|
|
714
714
|
const Component = ()=>{
|
|
@@ -6,7 +6,7 @@ let clientCode: string;
|
|
|
6
6
|
let serverCode: string;
|
|
7
7
|
|
|
8
8
|
const getModuleCode = (code: string, name: string) => {
|
|
9
|
-
const regexp = new RegExp(
|
|
9
|
+
const regexp = new RegExp(`\\./${name}":\\s*\n.+?{\n(.+?)/\\*{3}/\\s`, 's');
|
|
10
10
|
|
|
11
11
|
const match = code.match(regexp);
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ const normalizeCode = (code: string) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const getModuleCode = (code: string, name: string) => {
|
|
18
|
-
const regexp = new RegExp(
|
|
18
|
+
const regexp = new RegExp(`\\./${name}":.+?eval\\("{(.+?)//# sourceURL=`, 's');
|
|
19
19
|
|
|
20
20
|
const match = code.match(regexp);
|
|
21
21
|
|
|
@@ -6,7 +6,7 @@ import type { ConfigManager } from '../../../config/configManager';
|
|
|
6
6
|
import type { CliConfigEntry } from '../../../typings/configEntry/cli';
|
|
7
7
|
|
|
8
8
|
export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config) => {
|
|
9
|
-
const { debug, disableProdOptimization } = configManager;
|
|
9
|
+
const { debug, disableProdOptimization, readableOutput } = configManager;
|
|
10
10
|
|
|
11
11
|
const isProductionProfilingEnabled = !!process.env.TRAMVAI_REACT_PROFILE;
|
|
12
12
|
const tramvaiReactProfileTerserOptions = {
|
|
@@ -51,6 +51,13 @@ export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
if (readableOutput) {
|
|
55
|
+
// with this option for id of module path to file will be used
|
|
56
|
+
config.optimization.set('moduleIds', 'named');
|
|
57
|
+
// prevent modules from concatenation in single module to easier debug
|
|
58
|
+
config.optimization.set('concatenateModules', false);
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
const { terser } = configManager;
|
|
55
62
|
|
|
56
63
|
config.plugin('terser').use(TerserPlugin, [
|
|
@@ -144,18 +144,10 @@ export default (configManager: ConfigManager<ChildAppConfigEntry>) => (config: C
|
|
|
144
144
|
type: 'assign',
|
|
145
145
|
},
|
|
146
146
|
exposes: {
|
|
147
|
-
//
|
|
148
|
-
// as ChunkCorrelationPlugin fails to resolve
|
|
149
|
-
// entry otherwise.
|
|
150
|
-
// Way to reproduce: build and compare stats file for child-app with absolute and relative paths
|
|
151
|
-
// -----
|
|
152
|
-
// 2) path.relative should use the posix separator because
|
|
147
|
+
// path.relative should use the posix separator because
|
|
153
148
|
// @module-federation/node is parsing relative path incorrectly
|
|
154
149
|
// Debug notes: there is problem in webpack/ModuleFederation or enhanced-resolve
|
|
155
|
-
entry: path
|
|
156
|
-
.relative(config.get('context'), entry)
|
|
157
|
-
.split(path.win32.sep)
|
|
158
|
-
.join(path.posix.sep),
|
|
150
|
+
entry: entry.split(path.win32.sep).join(path.posix.sep),
|
|
159
151
|
},
|
|
160
152
|
shared: sharedModules,
|
|
161
153
|
} as UniversalFederationPluginOptions,
|
|
@@ -45,7 +45,7 @@ export default (configManager: ConfigManager<CliConfigEntry>) => (config: Config
|
|
|
45
45
|
config.set('ignoreWarnings', ignoreWarnings);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
config.context(
|
|
48
|
+
config.context(configManager.rootDir);
|
|
49
49
|
config.batch(resolve(configManager));
|
|
50
50
|
config.batch(ignoreLocales());
|
|
51
51
|
|
|
@@ -1351,23 +1351,23 @@
|
|
|
1351
1351
|
"dotAll": {
|
|
1352
1352
|
"type": "boolean"
|
|
1353
1353
|
},
|
|
1354
|
-
"__@match@
|
|
1354
|
+
"__@match@9030": {
|
|
1355
1355
|
"type": "object",
|
|
1356
1356
|
"additionalProperties": false
|
|
1357
1357
|
},
|
|
1358
|
-
"__@replace@
|
|
1358
|
+
"__@replace@9032": {
|
|
1359
1359
|
"type": "object",
|
|
1360
1360
|
"additionalProperties": false
|
|
1361
1361
|
},
|
|
1362
|
-
"__@search@
|
|
1362
|
+
"__@search@9035": {
|
|
1363
1363
|
"type": "object",
|
|
1364
1364
|
"additionalProperties": false
|
|
1365
1365
|
},
|
|
1366
|
-
"__@split@
|
|
1366
|
+
"__@split@9037": {
|
|
1367
1367
|
"type": "object",
|
|
1368
1368
|
"additionalProperties": false
|
|
1369
1369
|
},
|
|
1370
|
-
"__@matchAll@
|
|
1370
|
+
"__@matchAll@9039": {
|
|
1371
1371
|
"type": "object",
|
|
1372
1372
|
"additionalProperties": false
|
|
1373
1373
|
}
|
|
@@ -2213,23 +2213,23 @@
|
|
|
2213
2213
|
"dotAll": {
|
|
2214
2214
|
"type": "boolean"
|
|
2215
2215
|
},
|
|
2216
|
-
"__@match@
|
|
2216
|
+
"__@match@9030": {
|
|
2217
2217
|
"type": "object",
|
|
2218
2218
|
"additionalProperties": false
|
|
2219
2219
|
},
|
|
2220
|
-
"__@replace@
|
|
2220
|
+
"__@replace@9032": {
|
|
2221
2221
|
"type": "object",
|
|
2222
2222
|
"additionalProperties": false
|
|
2223
2223
|
},
|
|
2224
|
-
"__@search@
|
|
2224
|
+
"__@search@9035": {
|
|
2225
2225
|
"type": "object",
|
|
2226
2226
|
"additionalProperties": false
|
|
2227
2227
|
},
|
|
2228
|
-
"__@split@
|
|
2228
|
+
"__@split@9037": {
|
|
2229
2229
|
"type": "object",
|
|
2230
2230
|
"additionalProperties": false
|
|
2231
2231
|
},
|
|
2232
|
-
"__@matchAll@
|
|
2232
|
+
"__@matchAll@9039": {
|
|
2233
2233
|
"type": "object",
|
|
2234
2234
|
"additionalProperties": false
|
|
2235
2235
|
}
|
|
@@ -3075,23 +3075,23 @@
|
|
|
3075
3075
|
"dotAll": {
|
|
3076
3076
|
"type": "boolean"
|
|
3077
3077
|
},
|
|
3078
|
-
"__@match@
|
|
3078
|
+
"__@match@9030": {
|
|
3079
3079
|
"type": "object",
|
|
3080
3080
|
"additionalProperties": false
|
|
3081
3081
|
},
|
|
3082
|
-
"__@replace@
|
|
3082
|
+
"__@replace@9032": {
|
|
3083
3083
|
"type": "object",
|
|
3084
3084
|
"additionalProperties": false
|
|
3085
3085
|
},
|
|
3086
|
-
"__@search@
|
|
3086
|
+
"__@search@9035": {
|
|
3087
3087
|
"type": "object",
|
|
3088
3088
|
"additionalProperties": false
|
|
3089
3089
|
},
|
|
3090
|
-
"__@split@
|
|
3090
|
+
"__@split@9037": {
|
|
3091
3091
|
"type": "object",
|
|
3092
3092
|
"additionalProperties": false
|
|
3093
3093
|
},
|
|
3094
|
-
"__@matchAll@
|
|
3094
|
+
"__@matchAll@9039": {
|
|
3095
3095
|
"type": "object",
|
|
3096
3096
|
"additionalProperties": false
|
|
3097
3097
|
}
|