@bleedingdev/modern-js-app-tools 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10
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/bin/modern-bundle-docs.js +1 -1
- package/bin/modern.js +1 -1
- package/dist/cjs/builder/generator/adapterCopy.js +0 -26
- package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
- package/dist/cjs/run/index.js +4 -4
- package/dist/cjs/utils/register.js +1 -1
- package/dist/esm/builder/generator/adapterCopy.mjs +1 -23
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm/run/index.mjs +4 -4
- package/dist/esm/utils/register.mjs +1 -1
- package/dist/esm-node/builder/generator/adapterCopy.mjs +1 -23
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm-node/run/index.mjs +4 -4
- package/dist/esm-node/utils/register.mjs +1 -1
- package/dist/types/builder/generator/adapterCopy.d.ts +1 -13
- package/docs/configure/app/output/disable-css-module-extension.md +3 -3
- package/docs/configure/app/server/routes.md +1 -1
- package/docs/configure/app/server/ssr.md +1 -1
- package/docs/configure/app/tools/swc.md +2 -2
- package/docs/guides/advanced-features/server-monitor/logger.md +5 -5
- package/docs/guides/basic-features/env-vars.md +6 -6
- package/package.json +24 -24
|
@@ -6,7 +6,7 @@ if (
|
|
|
6
6
|
(+nodeVersion[1] === 26 && +nodeVersion[2] < 10)
|
|
7
7
|
) {
|
|
8
8
|
console.error(
|
|
9
|
-
`UltraModern.js requires Node.js >=26.
|
|
9
|
+
`UltraModern.js requires Node.js >=26.12.0; detected v${process.versions.node}. Legacy Node runtimes and transpiler fallbacks are unsupported.`,
|
|
10
10
|
);
|
|
11
11
|
process.exit(1);
|
|
12
12
|
}
|
package/bin/modern.js
CHANGED
|
@@ -6,7 +6,7 @@ if (
|
|
|
6
6
|
(+nodeVersion[1] === 26 && +nodeVersion[2] < 10)
|
|
7
7
|
) {
|
|
8
8
|
console.error(
|
|
9
|
-
`UltraModern.js requires Node.js >=26.
|
|
9
|
+
`UltraModern.js requires Node.js >=26.12.0; detected v${process.versions.node}. Legacy Node runtimes and transpiler fallbacks are unsupported.`,
|
|
10
10
|
);
|
|
11
11
|
process.exit(1);
|
|
12
12
|
}
|
|
@@ -37,29 +37,12 @@ var __webpack_require__ = {};
|
|
|
37
37
|
var __webpack_exports__ = {};
|
|
38
38
|
__webpack_require__.r(__webpack_exports__);
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
-
MissingCopyContextPlugin: ()=>MissingCopyContextPlugin,
|
|
41
40
|
builderPluginAdapterCopy: ()=>builderPluginAdapterCopy
|
|
42
41
|
});
|
|
43
|
-
const external_node_fs_namespaceObject = require("node:fs");
|
|
44
|
-
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
45
42
|
const external_path_namespaceObject = require("path");
|
|
46
43
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
47
44
|
const index_js_namespaceObject = require("../shared/index.js");
|
|
48
45
|
const external_createCopyPattern_js_namespaceObject = require("./createCopyPattern.js");
|
|
49
|
-
class MissingCopyContextPlugin {
|
|
50
|
-
apply(compiler) {
|
|
51
|
-
compiler.hooks.afterCompile.tap('MissingCopyContextPlugin', (compilation)=>{
|
|
52
|
-
for (const context of this.contexts)if (!external_node_fs_default().existsSync(context)) {
|
|
53
|
-
compilation.contextDependencies.delete(context);
|
|
54
|
-
compilation.missingDependencies.add(context);
|
|
55
|
-
for(let parent = external_path_default().dirname(context); parent !== external_path_default().dirname(parent) && !external_node_fs_default().existsSync(parent); parent = external_path_default().dirname(parent))compilation.missingDependencies.add(parent);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
constructor(contexts){
|
|
60
|
-
this.contexts = contexts;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
46
|
const builderPluginAdapterCopy = (options)=>({
|
|
64
47
|
name: 'builder-plugin-adapter-copy',
|
|
65
48
|
setup (api) {
|
|
@@ -87,21 +70,12 @@ const builderPluginAdapterCopy = (options)=>({
|
|
|
87
70
|
]
|
|
88
71
|
}
|
|
89
72
|
]);
|
|
90
|
-
const patterns = chain.plugin(CHAIN_ID.PLUGIN.COPY).get('args')?.[0]?.patterns ?? [];
|
|
91
|
-
const optionalContexts = patterns.flatMap((pattern)=>pattern && 'object' == typeof pattern && 'noErrorOnMissing' in pattern && pattern.noErrorOnMissing && 'context' in pattern && 'string' == typeof pattern.context ? [
|
|
92
|
-
external_path_default().resolve(appContext.appDirectory, pattern.context)
|
|
93
|
-
] : []);
|
|
94
|
-
if (optionalContexts.length) chain.plugin('modern-missing-copy-context').use(MissingCopyContextPlugin, [
|
|
95
|
-
optionalContexts
|
|
96
|
-
]);
|
|
97
73
|
}
|
|
98
74
|
});
|
|
99
75
|
}
|
|
100
76
|
});
|
|
101
|
-
exports.MissingCopyContextPlugin = __webpack_exports__.MissingCopyContextPlugin;
|
|
102
77
|
exports.builderPluginAdapterCopy = __webpack_exports__.builderPluginAdapterCopy;
|
|
103
78
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
104
|
-
"MissingCopyContextPlugin",
|
|
105
79
|
"builderPluginAdapterCopy"
|
|
106
80
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
107
81
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -52,7 +52,7 @@ const applyBaseUrl = (baseUrl, routes)=>{
|
|
|
52
52
|
...applyBaseUrl(current, routes)
|
|
53
53
|
], []);
|
|
54
54
|
else return routes.map((route)=>{
|
|
55
|
-
const urlPath = (0, utils_namespaceObject.urlJoin)(baseUrl, route.urlPath);
|
|
55
|
+
const urlPath = (0, utils_namespaceObject.urlJoin)(baseUrl, route.urlPath).replace(/^\/{2,}/, '/');
|
|
56
56
|
return {
|
|
57
57
|
...route,
|
|
58
58
|
urlPath: '/' === urlPath ? urlPath : (0, utils_namespaceObject.removeTailSlash)(urlPath)
|
package/dist/cjs/run/index.js
CHANGED
|
@@ -43,18 +43,18 @@ async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', versi
|
|
|
43
43
|
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 10) throw new Error(`
|
|
44
44
|
${utils_namespaceObject.chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
|
|
45
45
|
|
|
46
|
-
${utils_namespaceObject.chalk.red.bold(`UltraModern.js requires Node.js >=26.
|
|
46
|
+
${utils_namespaceObject.chalk.red.bold(`UltraModern.js requires Node.js >=26.12.0; detected v${nodeVersion}.`)}
|
|
47
47
|
${utils_namespaceObject.chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
|
|
48
48
|
|
|
49
49
|
${utils_namespaceObject.chalk.yellow('▸ Detected Runtime:')} ${utils_namespaceObject.chalk.yellow.bold(`Node.js v${nodeVersion}`)}
|
|
50
|
-
${utils_namespaceObject.chalk.green('▸ Required Minimum:')} ${utils_namespaceObject.chalk.green.bold('Node.js v26.
|
|
51
|
-
${utils_namespaceObject.chalk.green('▸ Pinned Runtime:')} ${utils_namespaceObject.chalk.green.bold('Node.js v26.
|
|
50
|
+
${utils_namespaceObject.chalk.green('▸ Required Minimum:')} ${utils_namespaceObject.chalk.green.bold('Node.js v26.12.0 or higher')}
|
|
51
|
+
${utils_namespaceObject.chalk.green('▸ Pinned Runtime:')} ${utils_namespaceObject.chalk.green.bold('Node.js v26.12.0')}
|
|
52
52
|
|
|
53
53
|
${utils_namespaceObject.chalk.cyan('Immediate Action Required:')}
|
|
54
54
|
${utils_namespaceObject.chalk.gray('├──')} ${utils_namespaceObject.chalk.yellow('Recommended Upgrade')}
|
|
55
55
|
${utils_namespaceObject.chalk.bold('mise install && mise exec -- node --version')}
|
|
56
56
|
${utils_namespaceObject.chalk.gray('├──')} ${utils_namespaceObject.chalk.yellow('Manual Installation')}
|
|
57
|
-
${utils_namespaceObject.chalk.underline('https://nodejs.org/download/release/v26.
|
|
57
|
+
${utils_namespaceObject.chalk.underline('https://nodejs.org/download/release/v26.12.0/')}
|
|
58
58
|
${utils_namespaceObject.chalk.gray('└──')} ${utils_namespaceObject.chalk.yellow('Environment Verification')}
|
|
59
59
|
${utils_namespaceObject.chalk.bold('node -v && npm -v')}
|
|
60
60
|
|
|
@@ -100,7 +100,7 @@ const resolveTsRuntimeRegisterMode = ()=>{
|
|
|
100
100
|
return 'unsupported';
|
|
101
101
|
};
|
|
102
102
|
const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
103
|
-
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.
|
|
103
|
+
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.12.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
|
|
104
104
|
const tsconfigPath = (0, utils_namespaceObject.resolveServerTsconfig)(appDir, options.tsconfigPath);
|
|
105
105
|
const isTsProject = await utils_namespaceObject.fs.pathExists(tsconfigPath);
|
|
106
106
|
if (!isTsProject) return;
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
import node_fs from "node:fs";
|
|
2
1
|
import path from "path";
|
|
3
2
|
import { createCopyInfo } from "../shared/index.mjs";
|
|
4
3
|
import { createPublicPattern } from "./createCopyPattern.mjs";
|
|
5
|
-
class MissingCopyContextPlugin {
|
|
6
|
-
apply(compiler) {
|
|
7
|
-
compiler.hooks.afterCompile.tap('MissingCopyContextPlugin', (compilation)=>{
|
|
8
|
-
for (const context of this.contexts)if (!node_fs.existsSync(context)) {
|
|
9
|
-
compilation.contextDependencies.delete(context);
|
|
10
|
-
compilation.missingDependencies.add(context);
|
|
11
|
-
for(let parent = path.dirname(context); parent !== path.dirname(parent) && !node_fs.existsSync(parent); parent = path.dirname(parent))compilation.missingDependencies.add(parent);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
constructor(contexts){
|
|
16
|
-
this.contexts = contexts;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
4
|
const builderPluginAdapterCopy = (options)=>({
|
|
20
5
|
name: 'builder-plugin-adapter-copy',
|
|
21
6
|
setup (api) {
|
|
@@ -43,15 +28,8 @@ const builderPluginAdapterCopy = (options)=>({
|
|
|
43
28
|
]
|
|
44
29
|
}
|
|
45
30
|
]);
|
|
46
|
-
const patterns = chain.plugin(CHAIN_ID.PLUGIN.COPY).get('args')?.[0]?.patterns ?? [];
|
|
47
|
-
const optionalContexts = patterns.flatMap((pattern)=>pattern && 'object' == typeof pattern && 'noErrorOnMissing' in pattern && pattern.noErrorOnMissing && 'context' in pattern && 'string' == typeof pattern.context ? [
|
|
48
|
-
path.resolve(appContext.appDirectory, pattern.context)
|
|
49
|
-
] : []);
|
|
50
|
-
if (optionalContexts.length) chain.plugin('modern-missing-copy-context').use(MissingCopyContextPlugin, [
|
|
51
|
-
optionalContexts
|
|
52
|
-
]);
|
|
53
31
|
}
|
|
54
32
|
});
|
|
55
33
|
}
|
|
56
34
|
});
|
|
57
|
-
export {
|
|
35
|
+
export { builderPluginAdapterCopy };
|
|
@@ -8,7 +8,7 @@ const applyBaseUrl = (baseUrl, routes)=>{
|
|
|
8
8
|
...applyBaseUrl(current, routes)
|
|
9
9
|
], []);
|
|
10
10
|
else return routes.map((route)=>{
|
|
11
|
-
const urlPath = urlJoin(baseUrl, route.urlPath);
|
|
11
|
+
const urlPath = urlJoin(baseUrl, route.urlPath).replace(/^\/{2,}/, '/');
|
|
12
12
|
return {
|
|
13
13
|
...route,
|
|
14
14
|
urlPath: '/' === urlPath ? urlPath : removeTailSlash(urlPath)
|
package/dist/esm/run/index.mjs
CHANGED
|
@@ -10,18 +10,18 @@ async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', versi
|
|
|
10
10
|
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 10) throw new Error(`
|
|
11
11
|
${chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
|
|
12
12
|
|
|
13
|
-
${chalk.red.bold(`UltraModern.js requires Node.js >=26.
|
|
13
|
+
${chalk.red.bold(`UltraModern.js requires Node.js >=26.12.0; detected v${nodeVersion}.`)}
|
|
14
14
|
${chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
|
|
15
15
|
|
|
16
16
|
${chalk.yellow('▸ Detected Runtime:')} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
|
|
17
|
-
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.
|
|
18
|
-
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.
|
|
17
|
+
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.12.0 or higher')}
|
|
18
|
+
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.12.0')}
|
|
19
19
|
|
|
20
20
|
${chalk.cyan('Immediate Action Required:')}
|
|
21
21
|
${chalk.gray('├──')} ${chalk.yellow('Recommended Upgrade')}
|
|
22
22
|
${chalk.bold('mise install && mise exec -- node --version')}
|
|
23
23
|
${chalk.gray('├──')} ${chalk.yellow('Manual Installation')}
|
|
24
|
-
${chalk.underline('https://nodejs.org/download/release/v26.
|
|
24
|
+
${chalk.underline('https://nodejs.org/download/release/v26.12.0/')}
|
|
25
25
|
${chalk.gray('└──')} ${chalk.yellow('Environment Verification')}
|
|
26
26
|
${chalk.bold('node -v && npm -v')}
|
|
27
27
|
|
|
@@ -57,7 +57,7 @@ const resolveTsRuntimeRegisterMode = ()=>{
|
|
|
57
57
|
return 'unsupported';
|
|
58
58
|
};
|
|
59
59
|
const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
60
|
-
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.
|
|
60
|
+
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.12.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
|
|
61
61
|
const tsconfigPath = resolveServerTsconfig(appDir, options.tsconfigPath);
|
|
62
62
|
const isTsProject = await fs.pathExists(tsconfigPath);
|
|
63
63
|
if (!isTsProject) return;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import node_fs from "node:fs";
|
|
3
2
|
import path from "path";
|
|
4
3
|
import { createCopyInfo } from "../shared/index.mjs";
|
|
5
4
|
import { createPublicPattern } from "./createCopyPattern.mjs";
|
|
6
|
-
class MissingCopyContextPlugin {
|
|
7
|
-
apply(compiler) {
|
|
8
|
-
compiler.hooks.afterCompile.tap('MissingCopyContextPlugin', (compilation)=>{
|
|
9
|
-
for (const context of this.contexts)if (!node_fs.existsSync(context)) {
|
|
10
|
-
compilation.contextDependencies.delete(context);
|
|
11
|
-
compilation.missingDependencies.add(context);
|
|
12
|
-
for(let parent = path.dirname(context); parent !== path.dirname(parent) && !node_fs.existsSync(parent); parent = path.dirname(parent))compilation.missingDependencies.add(parent);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
constructor(contexts){
|
|
17
|
-
this.contexts = contexts;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
5
|
const builderPluginAdapterCopy = (options)=>({
|
|
21
6
|
name: 'builder-plugin-adapter-copy',
|
|
22
7
|
setup (api) {
|
|
@@ -44,15 +29,8 @@ const builderPluginAdapterCopy = (options)=>({
|
|
|
44
29
|
]
|
|
45
30
|
}
|
|
46
31
|
]);
|
|
47
|
-
const patterns = chain.plugin(CHAIN_ID.PLUGIN.COPY).get('args')?.[0]?.patterns ?? [];
|
|
48
|
-
const optionalContexts = patterns.flatMap((pattern)=>pattern && 'object' == typeof pattern && 'noErrorOnMissing' in pattern && pattern.noErrorOnMissing && 'context' in pattern && 'string' == typeof pattern.context ? [
|
|
49
|
-
path.resolve(appContext.appDirectory, pattern.context)
|
|
50
|
-
] : []);
|
|
51
|
-
if (optionalContexts.length) chain.plugin('modern-missing-copy-context').use(MissingCopyContextPlugin, [
|
|
52
|
-
optionalContexts
|
|
53
|
-
]);
|
|
54
32
|
}
|
|
55
33
|
});
|
|
56
34
|
}
|
|
57
35
|
});
|
|
58
|
-
export {
|
|
36
|
+
export { builderPluginAdapterCopy };
|
|
@@ -9,7 +9,7 @@ const applyBaseUrl = (baseUrl, routes)=>{
|
|
|
9
9
|
...applyBaseUrl(current, routes)
|
|
10
10
|
], []);
|
|
11
11
|
else return routes.map((route)=>{
|
|
12
|
-
const urlPath = urlJoin(baseUrl, route.urlPath);
|
|
12
|
+
const urlPath = urlJoin(baseUrl, route.urlPath).replace(/^\/{2,}/, '/');
|
|
13
13
|
return {
|
|
14
14
|
...route,
|
|
15
15
|
urlPath: '/' === urlPath ? urlPath : removeTailSlash(urlPath)
|
|
@@ -11,18 +11,18 @@ async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', versi
|
|
|
11
11
|
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 10) throw new Error(`
|
|
12
12
|
${chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
|
|
13
13
|
|
|
14
|
-
${chalk.red.bold(`UltraModern.js requires Node.js >=26.
|
|
14
|
+
${chalk.red.bold(`UltraModern.js requires Node.js >=26.12.0; detected v${nodeVersion}.`)}
|
|
15
15
|
${chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
|
|
16
16
|
|
|
17
17
|
${chalk.yellow('▸ Detected Runtime:')} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
|
|
18
|
-
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.
|
|
19
|
-
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.
|
|
18
|
+
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.12.0 or higher')}
|
|
19
|
+
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.12.0')}
|
|
20
20
|
|
|
21
21
|
${chalk.cyan('Immediate Action Required:')}
|
|
22
22
|
${chalk.gray('├──')} ${chalk.yellow('Recommended Upgrade')}
|
|
23
23
|
${chalk.bold('mise install && mise exec -- node --version')}
|
|
24
24
|
${chalk.gray('├──')} ${chalk.yellow('Manual Installation')}
|
|
25
|
-
${chalk.underline('https://nodejs.org/download/release/v26.
|
|
25
|
+
${chalk.underline('https://nodejs.org/download/release/v26.12.0/')}
|
|
26
26
|
${chalk.gray('└──')} ${chalk.yellow('Environment Verification')}
|
|
27
27
|
${chalk.bold('node -v && npm -v')}
|
|
28
28
|
|
|
@@ -59,7 +59,7 @@ const resolveTsRuntimeRegisterMode = ()=>{
|
|
|
59
59
|
return 'unsupported';
|
|
60
60
|
};
|
|
61
61
|
const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
62
|
-
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.
|
|
62
|
+
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.12.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
|
|
63
63
|
const tsconfigPath = resolveServerTsconfig(appDir, options.tsconfigPath);
|
|
64
64
|
const isTsProject = await fs.pathExists(tsconfigPath);
|
|
65
65
|
if (!isTsProject) return;
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import type { RsbuildPlugin
|
|
1
|
+
import type { RsbuildPlugin } from '@modern-js/builder';
|
|
2
2
|
import type { BuilderOptions } from '../shared/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* The copy plugin registers each pattern context as a context dependency even
|
|
5
|
-
* when the directory is absent. The watcher reports an absent context as
|
|
6
|
-
* removed right after the first build, which rebuilds every dev session once.
|
|
7
|
-
* Watch an absent context, and its absent parents, as missing instead: their
|
|
8
|
-
* later creation still rebuilds and copies.
|
|
9
|
-
*/
|
|
10
|
-
export declare class MissingCopyContextPlugin {
|
|
11
|
-
private readonly contexts;
|
|
12
|
-
constructor(contexts: readonly string[]);
|
|
13
|
-
apply(compiler: Rspack.Compiler): void;
|
|
14
|
-
}
|
|
15
3
|
export declare const builderPluginAdapterCopy: (options: BuilderOptions) => RsbuildPlugin;
|
|
@@ -45,13 +45,13 @@ The following files are treated as normal CSS:
|
|
|
45
45
|
The following files are treated as CSS Modules:
|
|
46
46
|
|
|
47
47
|
- `*.css` and `*.module.css` files in the source directory
|
|
48
|
-
- `*.module.css` files under
|
|
48
|
+
- `*.module.css` files under node_modules
|
|
49
49
|
|
|
50
50
|
The following files are treated as normal CSS:
|
|
51
51
|
|
|
52
52
|
- all `*.global.css` files
|
|
53
|
-
- `*.css` files under
|
|
53
|
+
- `*.css` files under node_modules (without `.module`)
|
|
54
54
|
|
|
55
55
|
:::tip
|
|
56
|
-
For CSS Modules files inside
|
|
56
|
+
For CSS Modules files inside node_modules, please always use the `*.module.css` suffix.
|
|
57
57
|
:::
|
|
@@ -83,6 +83,6 @@ export default defineConfig({
|
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
:::note
|
|
86
|
-
This configuration takes effect in both the production and development environments, and different response headers can be set according to the
|
|
86
|
+
This configuration takes effect in both the production and development environments, and different response headers can be set according to the NODE_ENV to distinguish between environments. However, if you only need to set response headers in the development environment, it is recommended to use `tools.devServer.headers`.
|
|
87
87
|
|
|
88
88
|
:::
|
|
@@ -27,7 +27,7 @@ When the value type is `Object`, the following properties can be configured:
|
|
|
27
27
|
| ---------------------- | ------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
28
|
| mode | `string` | `stream` | which defaults to using streaming rendering. Configure `string` to use `renderToString` for rendering |
|
|
29
29
|
| forceCSR | `boolean` | `false` | which is off by default for forcing CSR rendering. Configure `true` to force CSR by adding `?csr=true` or adding `x-modern-ssr-fallback` header when accessing the page |
|
|
30
|
-
| unsafeHeaders | `string[]` | `[]` | For safety reasons, Modern.js does not add excessive content to
|
|
30
|
+
| unsafeHeaders | `string[]` | `[]` | For safety reasons, Modern.js does not add excessive content to SSR_DATA. Developers can use this configuration to specify the headers that need to be injected |
|
|
31
31
|
| loaderFailureMode | `clientRender \| errorBoundary` | `errorBoundary` | The default configuration is `'errorBoundary'`, when an error occurs in [data loader](/guides/basic-features/data/data-fetch.md#data-loader-recommended), it will default to rendering the [`Error`](/guides/basic-features/routes/routes.md#error-handling) component of the route. When configured as `'clientRender'`, if a loader throws an error, it switch to client-side rendering,you can use it with [Client Loader](/guides/basic-features/data/data-fetch.md#client-loader) |
|
|
32
32
|
| moduleFederationAppSSR | `boolean` | `false` | Enables app-level Module Federation SSR contract handshake. Enable this in both host and remote apps when using app-level MF SSR |
|
|
33
33
|
|
|
@@ -53,9 +53,9 @@ export default {
|
|
|
53
53
|
};
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Please note that the SWC plugin is still an experimental feature, and the SWC Wasm plugin is currently not backward compatible. The version of the SWC plugin is closely tied to the version of
|
|
56
|
+
Please note that the SWC plugin is still an experimental feature, and the SWC Wasm plugin is currently not backward compatible. The version of the SWC plugin is closely tied to the version of swc_core that Rspack depends on.
|
|
57
57
|
|
|
58
|
-
This means that you must to choose an SWC plugin that matches the current version of
|
|
58
|
+
This means that you must to choose an SWC plugin that matches the current version of swc_core to ensure that it works properly. If the version of the SWC plugin you are using does not match the version of swc_core that Rspack depends on, Rspack will throw the following error during the build process:
|
|
59
59
|
|
|
60
60
|
```
|
|
61
61
|
1: failed to run Wasm plugin transform. Please ensure the version of `swc_core`
|
|
@@ -8,11 +8,11 @@ Log events are distributed by Modern.js as events of type `log`.
|
|
|
8
8
|
|
|
9
9
|
Based on server-side runtime logic, Modern.js provides the following log events:
|
|
10
10
|
|
|
11
|
-
| Stage
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
11
|
+
| Stage | Message | Level |
|
|
12
|
+
| ------------- | --------------------------------------------- | ----- |
|
|
13
|
+
| RENDER_HTML | App Render To HTML | error |
|
|
14
|
+
| RENDER_STREAM | An error occurs during streaming SSR | error |
|
|
15
|
+
| RENDER_SHELL | An error occurs during streaming render shell | error |
|
|
16
16
|
|
|
17
17
|
## Built-in Monitor
|
|
18
18
|
|
|
@@ -6,27 +6,27 @@ Modern.js provides support for environment variables, including built-in environ
|
|
|
6
6
|
|
|
7
7
|
## Built-in Environment Variables
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### ASSET_PREFIX
|
|
10
10
|
|
|
11
11
|
The current path prefix of the asset, which is a read-only environment variable.
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### NODE_ENV
|
|
14
14
|
|
|
15
15
|
The current execution environment and is a **read-only** environment variable whose have different values under different execution commands:
|
|
16
16
|
|
|
17
17
|
- `production`: Default value when running `modern build` or `modern serve`.
|
|
18
18
|
- `development`: Default value when running `modern dev`, also the default value in other cases.
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### MODERN_ENV
|
|
21
21
|
|
|
22
|
-
Set the current execution environment manually. In addition to the values in the
|
|
22
|
+
Set the current execution environment manually. In addition to the values in the NODE_ENV, custom environment names are supported here, such as `staging`, `boe`, etc.
|
|
23
23
|
|
|
24
24
|
:::tip
|
|
25
|
-
|
|
25
|
+
MODERN_ENV priority is higher than NODE_ENV.
|
|
26
26
|
|
|
27
27
|
:::
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### MODERN_TARGET
|
|
30
30
|
|
|
31
31
|
When using `@modern-js/runtime`, Modern.js will automatically inject `MODERN_TARGET` to distinguish between SSR and CSR environments.
|
|
32
32
|
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.9.3-ultramodern.
|
|
20
|
+
"version": "3.9.3-ultramodern.10",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
|
-
"node": ">=26.
|
|
74
|
+
"node": ">=26.12.0"
|
|
75
75
|
},
|
|
76
76
|
"typesVersions": {
|
|
77
77
|
"*": {
|
|
@@ -129,34 +129,34 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@babel/parser": "^8.0.
|
|
133
|
-
"@babel/traverse": "^8.0.
|
|
132
|
+
"@babel/parser": "^8.0.7",
|
|
133
|
+
"@babel/traverse": "^8.0.7",
|
|
134
134
|
"@babel/types": "^8.0.6",
|
|
135
|
-
"@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.3-ultramodern.
|
|
136
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.
|
|
137
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.9.3-ultramodern.
|
|
138
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.
|
|
139
|
-
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.3-ultramodern.
|
|
140
|
-
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.
|
|
141
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.3-ultramodern.
|
|
142
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.
|
|
143
|
-
"@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.
|
|
144
|
-
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.3-ultramodern.
|
|
145
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.
|
|
146
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.
|
|
147
|
-
"@rsbuild/core": "2.2.
|
|
148
|
-
"@swc/core": "1.16.
|
|
135
|
+
"@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.3-ultramodern.10",
|
|
136
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.10",
|
|
137
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.9.3-ultramodern.10",
|
|
138
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.10",
|
|
139
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.3-ultramodern.10",
|
|
140
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.10",
|
|
141
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.3-ultramodern.10",
|
|
142
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.10",
|
|
143
|
+
"@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.10",
|
|
144
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.3-ultramodern.10",
|
|
145
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.10",
|
|
146
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.10",
|
|
147
|
+
"@rsbuild/core": "2.2.13",
|
|
148
|
+
"@swc/core": "1.16.18",
|
|
149
149
|
"@swc/helpers": "^0.5.23",
|
|
150
150
|
"@types/babel__core": "^7.20.5",
|
|
151
151
|
"compression-webpack-plugin": "^12.0.0",
|
|
152
|
-
"es-module-lexer": "^3.0.
|
|
152
|
+
"es-module-lexer": "^3.0.4",
|
|
153
153
|
"esbuild": "^0.28.2",
|
|
154
154
|
"flatted": "^3.4.4",
|
|
155
155
|
"import-meta-resolve": "^4.2.0",
|
|
156
156
|
"mlly": "^1.8.2",
|
|
157
157
|
"ndepe": "^0.1.13",
|
|
158
158
|
"pkg-types": "^2.3.3",
|
|
159
|
-
"prettier": "~3.9.
|
|
159
|
+
"prettier": "~3.9.10",
|
|
160
160
|
"std-env": "4.3.0"
|
|
161
161
|
},
|
|
162
162
|
"devDependencies": {
|
|
@@ -165,15 +165,15 @@
|
|
|
165
165
|
"@rslib/core": "1.0.3",
|
|
166
166
|
"@scripts/rstest-config": "2.66.0",
|
|
167
167
|
"@types/babel__traverse": "7.28.0",
|
|
168
|
-
"@types/node": "^26.6.
|
|
169
|
-
"react": "^19.3.
|
|
170
|
-
"react-dom": "^19.3.
|
|
168
|
+
"@types/node": "^26.6.5",
|
|
169
|
+
"react": "^19.3.1",
|
|
170
|
+
"react-dom": "^19.3.1",
|
|
171
171
|
"typescript": "7.0.2"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
174
|
"@loadable/component": "5.16.7",
|
|
175
175
|
"@rsbuild/plugin-svgr": "2.0.5",
|
|
176
|
-
"react": "^19.
|
|
176
|
+
"react": "^19.3.1"
|
|
177
177
|
},
|
|
178
178
|
"peerDependenciesMeta": {
|
|
179
179
|
"@loadable/component": {
|