@modern-js/runtime 2.49.3 → 2.49.4
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/dist/cjs/ssr/cli/index.js +9 -13
- package/dist/esm/ssr/cli/index.js +9 -13
- package/dist/esm-node/ssr/cli/index.js +9 -13
- package/package.json +10 -10
|
@@ -65,30 +65,26 @@ const ssrPlugin = () => ({
|
|
|
65
65
|
return {
|
|
66
66
|
config() {
|
|
67
67
|
const appContext = api.useAppContext();
|
|
68
|
-
const userConfig = api.useConfigContext();
|
|
69
68
|
pluginsExportsUtils = (0, import_utils.createRuntimeExportsUtils)(appContext.internalDirectory, "plugins");
|
|
70
69
|
const { bundlerType = "webpack" } = api.useAppContext();
|
|
71
70
|
const babelHandler = (() => {
|
|
72
71
|
if (bundlerType === "webpack") {
|
|
73
72
|
return (config) => {
|
|
74
73
|
var _config_plugins;
|
|
75
|
-
const
|
|
74
|
+
const userConfig = api.useResolvedConfigContext();
|
|
76
75
|
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(import_path.default.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
77
|
-
if ((0, import_utils.isUseSSRBundle)(
|
|
76
|
+
if ((0, import_utils.isUseSSRBundle)(userConfig) && checkUseStringSSR(userConfig)) {
|
|
78
77
|
var _config_plugins1;
|
|
79
78
|
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
81
|
} else if (bundlerType === "rspack") {
|
|
83
82
|
return (config) => {
|
|
84
|
-
const
|
|
85
|
-
if ((0, import_utils.isUseSSRBundle)(
|
|
86
|
-
var _config_plugins;
|
|
83
|
+
const userConfig = api.useResolvedConfigContext();
|
|
84
|
+
if ((0, import_utils.isUseSSRBundle)(userConfig) && checkUseStringSSR(userConfig)) {
|
|
85
|
+
var _config_plugins, _config_plugins1;
|
|
87
86
|
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(import_path.default.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
88
|
-
|
|
89
|
-
var _config_plugins1;
|
|
90
|
-
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
91
|
-
}
|
|
87
|
+
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
92
88
|
}
|
|
93
89
|
};
|
|
94
90
|
}
|
|
@@ -106,8 +102,8 @@ const ssrPlugin = () => ({
|
|
|
106
102
|
},
|
|
107
103
|
tools: {
|
|
108
104
|
bundlerChain(chain, { isServer, isServiceWorker }) {
|
|
109
|
-
const
|
|
110
|
-
if ((0, import_utils.isUseSSRBundle)(
|
|
105
|
+
const userConfig = api.useResolvedConfigContext();
|
|
106
|
+
if ((0, import_utils.isUseSSRBundle)(userConfig) && !isServer && !isServiceWorker && checkUseStringSSR(userConfig)) {
|
|
111
107
|
const LoadableBundlerPlugin = require("./loadable-bundler-plugin.js");
|
|
112
108
|
chain.plugin("loadable").use(LoadableBundlerPlugin, [
|
|
113
109
|
{
|
|
@@ -116,7 +112,7 @@ const ssrPlugin = () => ({
|
|
|
116
112
|
]);
|
|
117
113
|
}
|
|
118
114
|
},
|
|
119
|
-
babel:
|
|
115
|
+
babel: babelHandler
|
|
120
116
|
}
|
|
121
117
|
};
|
|
122
118
|
},
|
|
@@ -53,30 +53,26 @@ var ssrPlugin = function() {
|
|
|
53
53
|
return {
|
|
54
54
|
config: function config() {
|
|
55
55
|
var appContext = api.useAppContext();
|
|
56
|
-
var userConfig = api.useConfigContext();
|
|
57
56
|
pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
|
|
58
57
|
var _api_useAppContext = api.useAppContext(), _api_useAppContext_bundlerType = _api_useAppContext.bundlerType, bundlerType = _api_useAppContext_bundlerType === void 0 ? "webpack" : _api_useAppContext_bundlerType;
|
|
59
58
|
var babelHandler = function() {
|
|
60
59
|
if (bundlerType === "webpack") {
|
|
61
60
|
return function(config2) {
|
|
62
61
|
var _config_plugins;
|
|
63
|
-
var
|
|
62
|
+
var userConfig = api.useResolvedConfigContext();
|
|
64
63
|
(_config_plugins = config2.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(path.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
65
|
-
if (isUseSSRBundle(
|
|
64
|
+
if (isUseSSRBundle(userConfig) && checkUseStringSSR(userConfig)) {
|
|
66
65
|
var _config_plugins1;
|
|
67
66
|
(_config_plugins1 = config2.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
69
|
} else if (bundlerType === "rspack") {
|
|
71
70
|
return function(config2) {
|
|
72
|
-
var
|
|
73
|
-
if (isUseSSRBundle(
|
|
74
|
-
var _config_plugins;
|
|
71
|
+
var userConfig = api.useResolvedConfigContext();
|
|
72
|
+
if (isUseSSRBundle(userConfig) && checkUseStringSSR(userConfig)) {
|
|
73
|
+
var _config_plugins, _config_plugins1;
|
|
75
74
|
(_config_plugins = config2.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(path.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
76
|
-
|
|
77
|
-
var _config_plugins1;
|
|
78
|
-
(_config_plugins1 = config2.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
79
|
-
}
|
|
75
|
+
(_config_plugins1 = config2.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
80
76
|
}
|
|
81
77
|
};
|
|
82
78
|
}
|
|
@@ -96,8 +92,8 @@ var ssrPlugin = function() {
|
|
|
96
92
|
tools: {
|
|
97
93
|
bundlerChain: function bundlerChain(chain, param) {
|
|
98
94
|
var isServer = param.isServer, isServiceWorker = param.isServiceWorker;
|
|
99
|
-
var
|
|
100
|
-
if (isUseSSRBundle(
|
|
95
|
+
var userConfig = api.useResolvedConfigContext();
|
|
96
|
+
if (isUseSSRBundle(userConfig) && !isServer && !isServiceWorker && checkUseStringSSR(userConfig)) {
|
|
101
97
|
var LoadableBundlerPlugin = require("./loadable-bundler-plugin.js");
|
|
102
98
|
chain.plugin("loadable").use(LoadableBundlerPlugin, [
|
|
103
99
|
{
|
|
@@ -106,7 +102,7 @@ var ssrPlugin = function() {
|
|
|
106
102
|
]);
|
|
107
103
|
}
|
|
108
104
|
},
|
|
109
|
-
babel:
|
|
105
|
+
babel: babelHandler
|
|
110
106
|
}
|
|
111
107
|
};
|
|
112
108
|
},
|
|
@@ -31,30 +31,26 @@ const ssrPlugin = () => ({
|
|
|
31
31
|
return {
|
|
32
32
|
config() {
|
|
33
33
|
const appContext = api.useAppContext();
|
|
34
|
-
const userConfig = api.useConfigContext();
|
|
35
34
|
pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
|
|
36
35
|
const { bundlerType = "webpack" } = api.useAppContext();
|
|
37
36
|
const babelHandler = (() => {
|
|
38
37
|
if (bundlerType === "webpack") {
|
|
39
38
|
return (config) => {
|
|
40
39
|
var _config_plugins;
|
|
41
|
-
const
|
|
40
|
+
const userConfig = api.useResolvedConfigContext();
|
|
42
41
|
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(path.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
43
|
-
if (isUseSSRBundle(
|
|
42
|
+
if (isUseSSRBundle(userConfig) && checkUseStringSSR(userConfig)) {
|
|
44
43
|
var _config_plugins1;
|
|
45
44
|
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
} else if (bundlerType === "rspack") {
|
|
49
48
|
return (config) => {
|
|
50
|
-
const
|
|
51
|
-
if (isUseSSRBundle(
|
|
52
|
-
var _config_plugins;
|
|
49
|
+
const userConfig = api.useResolvedConfigContext();
|
|
50
|
+
if (isUseSSRBundle(userConfig) && checkUseStringSSR(userConfig)) {
|
|
51
|
+
var _config_plugins, _config_plugins1;
|
|
53
52
|
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push(path.join(__dirname, "./babel-plugin-ssr-loader-id"));
|
|
54
|
-
|
|
55
|
-
var _config_plugins1;
|
|
56
|
-
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
57
|
-
}
|
|
53
|
+
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(require.resolve("@loadable/babel-plugin"));
|
|
58
54
|
}
|
|
59
55
|
};
|
|
60
56
|
}
|
|
@@ -72,8 +68,8 @@ const ssrPlugin = () => ({
|
|
|
72
68
|
},
|
|
73
69
|
tools: {
|
|
74
70
|
bundlerChain(chain, { isServer, isServiceWorker }) {
|
|
75
|
-
const
|
|
76
|
-
if (isUseSSRBundle(
|
|
71
|
+
const userConfig = api.useResolvedConfigContext();
|
|
72
|
+
if (isUseSSRBundle(userConfig) && !isServer && !isServiceWorker && checkUseStringSSR(userConfig)) {
|
|
77
73
|
const LoadableBundlerPlugin = require("./loadable-bundler-plugin.js");
|
|
78
74
|
chain.plugin("loadable").use(LoadableBundlerPlugin, [
|
|
79
75
|
{
|
|
@@ -82,7 +78,7 @@ const ssrPlugin = () => ({
|
|
|
82
78
|
]);
|
|
83
79
|
}
|
|
84
80
|
},
|
|
85
|
-
babel:
|
|
81
|
+
babel: babelHandler
|
|
86
82
|
}
|
|
87
83
|
};
|
|
88
84
|
},
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.49.
|
|
18
|
+
"version": "2.49.4",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -170,10 +170,10 @@
|
|
|
170
170
|
"react-side-effect": "^2.1.1",
|
|
171
171
|
"styled-components": "^5.3.1",
|
|
172
172
|
"@swc/helpers": "0.5.3",
|
|
173
|
-
"@modern-js/plugin": "2.49.
|
|
174
|
-
"@modern-js/
|
|
175
|
-
"@modern-js/
|
|
176
|
-
"@modern-js/runtime-utils": "2.49.
|
|
173
|
+
"@modern-js/plugin": "2.49.4",
|
|
174
|
+
"@modern-js/types": "2.49.4",
|
|
175
|
+
"@modern-js/utils": "2.49.4",
|
|
176
|
+
"@modern-js/runtime-utils": "2.49.4"
|
|
177
177
|
},
|
|
178
178
|
"peerDependencies": {
|
|
179
179
|
"react": ">=17",
|
|
@@ -194,11 +194,11 @@
|
|
|
194
194
|
"ts-jest": "^29.1.0",
|
|
195
195
|
"typescript": "^5",
|
|
196
196
|
"webpack": "^5.91.0",
|
|
197
|
-
"@modern-js/app-tools": "2.49.
|
|
198
|
-
"@modern-js/core": "2.49.
|
|
199
|
-
"@
|
|
200
|
-
"@
|
|
201
|
-
"@scripts/jest-config": "2.49.
|
|
197
|
+
"@modern-js/app-tools": "2.49.4",
|
|
198
|
+
"@modern-js/core": "2.49.4",
|
|
199
|
+
"@modern-js/server-core": "2.49.4",
|
|
200
|
+
"@scripts/build": "2.49.4",
|
|
201
|
+
"@scripts/jest-config": "2.49.4"
|
|
202
202
|
},
|
|
203
203
|
"sideEffects": false,
|
|
204
204
|
"publishConfig": {
|