@modern-js/main-doc 0.0.0-nightly-20250427160323 → 0.0.0-nightly-20250429161419
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/docs/en/configure/app/output/filename.mdx +8 -3
- package/docs/zh/configure/app/output/filename.mdx +8 -0
- package/package.json +2 -2
- /package/docs/en/configure/app/source/{mainEntryName.mdx → main-entry-name.mdx} +0 -0
- /package/docs/zh/configure/app/source/{mainEntryName.mdx → main-entry-name.mdx} +0 -0
|
@@ -3,13 +3,20 @@ title: filename
|
|
|
3
3
|
configName: output.filename
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
:::warning
|
|
7
|
+
|
|
8
|
+
In Modern.js `dev` command or use Modern.js server deployment, don't modify the html output filename. This will cause the page to be 404.
|
|
9
|
+
|
|
10
|
+
In common, you don't need to modify the html filename. If you want modify `main.html` to `index.html`, using [source.mainEntryName](/configure/app/source/main-entry-name).
|
|
11
|
+
|
|
12
|
+
:::
|
|
13
|
+
|
|
6
14
|
# output.filename
|
|
7
15
|
|
|
8
16
|
- **Type:**
|
|
9
17
|
|
|
10
18
|
```ts
|
|
11
19
|
type FilenameConfig = {
|
|
12
|
-
html?: string;
|
|
13
20
|
js?:
|
|
14
21
|
| string
|
|
15
22
|
| ((pathData: Rspack.PathData, assetInfo: Rspack.JsAssetInfo) => string);
|
|
@@ -27,7 +34,6 @@ type FilenameConfig = {
|
|
|
27
34
|
```js
|
|
28
35
|
// Development mode
|
|
29
36
|
const devDefaultFilename = {
|
|
30
|
-
html: '[name].html',
|
|
31
37
|
js: '[name].js',
|
|
32
38
|
css: '[name].css',
|
|
33
39
|
svg: '[name].[contenthash:8].svg',
|
|
@@ -39,7 +45,6 @@ const devDefaultFilename = {
|
|
|
39
45
|
|
|
40
46
|
// Production mode
|
|
41
47
|
const prodDefaultFilename = {
|
|
42
|
-
html: '[name].html',
|
|
43
48
|
js: output.target === 'node' ? '[name].js' : '[name].[contenthash:8].js',
|
|
44
49
|
css: '[name].[contenthash:8].css',
|
|
45
50
|
svg: '[name].[contenthash:8].svg',
|
|
@@ -3,6 +3,14 @@ title: filename
|
|
|
3
3
|
configName: output.filename
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
:::warning
|
|
7
|
+
|
|
8
|
+
在 Modern.js 开发阶段,或是使用 Modern.js 服务器部署应用时,应避免使用该配置修改 html 产物文件名,会导致页面 404。
|
|
9
|
+
|
|
10
|
+
通常情况下,无需修改 html 产物文件名。常见的需求是将 `main.html` 修改为 `index.html`,请使用 [source.mainEntryName](/configure/app/source/main-entry-name)。
|
|
11
|
+
|
|
12
|
+
:::
|
|
13
|
+
|
|
6
14
|
# output.filename
|
|
7
15
|
|
|
8
16
|
- **类型:**
|
package/package.json
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-nightly-
|
|
18
|
+
"version": "0.0.0-nightly-20250429161419",
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"mermaid": "^11.4.1",
|
|
25
|
-
"@modern-js/sandpack-react": "0.0.0-nightly-
|
|
25
|
+
"@modern-js/sandpack-react": "0.0.0-nightly-20250429161419"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@rspress/shared": "1.43.11",
|
|
File without changes
|
|
File without changes
|