@modern-js/main-doc 0.0.0-nightly-20240305170715 → 0.0.0-nightly-20240307170627
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.
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
sidebar_label: filenameHash
|
3
|
+
---
|
4
|
+
|
5
|
+
# output.filenameHash
|
6
|
+
|
7
|
+
- **Type:** `boolean | string`
|
8
|
+
- **Default:** `true`
|
9
|
+
|
10
|
+
Whether to add a hash value to the filename after the production build.
|
11
|
+
|
12
|
+
### Example
|
13
|
+
|
14
|
+
By default, the filename of the output files will include a hash value:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
dist/static/css/index.7879e19d.css
|
18
|
+
dist/static/js/index.18a568e5.js
|
19
|
+
```
|
20
|
+
|
21
|
+
You can set `output.filenameHash` to false to disable this behavior:
|
22
|
+
|
23
|
+
```js
|
24
|
+
export default {
|
25
|
+
output: {
|
26
|
+
filenameHash: false,
|
27
|
+
},
|
28
|
+
};
|
29
|
+
```
|
30
|
+
|
31
|
+
After rebuilding, the output filenames becomes:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
dist/static/css/index.css
|
35
|
+
dist/static/js/index.js
|
36
|
+
```
|
37
|
+
|
38
|
+
For detailed usage, please refer to [Rsbuild - output.filenameHash](https://rsbuild.dev/config/output/filename-hash).
|
39
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
sidebar_label: decorators
|
3
|
+
---
|
4
|
+
|
5
|
+
# source.decorators
|
6
|
+
|
7
|
+
- **Type:**
|
8
|
+
```
|
9
|
+
type Decorators = {
|
10
|
+
version?: 'legacy' | '2022-03';
|
11
|
+
};
|
12
|
+
```
|
13
|
+
|
14
|
+
- **Default:**
|
15
|
+
|
16
|
+
```
|
17
|
+
type Decorators = {
|
18
|
+
version: 'legacy',
|
19
|
+
};
|
20
|
+
```
|
21
|
+
|
22
|
+
Used to configure the decorators syntax.
|
23
|
+
|
24
|
+
### Example
|
25
|
+
|
26
|
+
Modern.js uses `legacy` syntax by default (Stage 1 proposal), equivalent to TypeScript's `experimentalDecorators: true`.
|
27
|
+
|
28
|
+
You can adjust the decorator syntax to the Stage 3 decorator proposal by setting `decorators.version` to `2022-03`.
|
29
|
+
|
30
|
+
```js
|
31
|
+
export default {
|
32
|
+
source: {
|
33
|
+
decorators: {
|
34
|
+
version: '2022-03',
|
35
|
+
},
|
36
|
+
},
|
37
|
+
};
|
38
|
+
```
|
39
|
+
|
40
|
+
For detailed usage, please refer to [Rsbuild - source.decorators](https://rsbuild.dev/config/source/decorators).
|
41
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
sidebar_label: filenameHash
|
3
|
+
---
|
4
|
+
|
5
|
+
# output.filenameHash
|
6
|
+
|
7
|
+
- **类型:** `boolean | string`
|
8
|
+
- **默认值:** `true`
|
9
|
+
|
10
|
+
在生产环境构建后,是否在产物的文件名中添加 hash 值。
|
11
|
+
|
12
|
+
### 示例
|
13
|
+
|
14
|
+
默认情况下,构建后的产物名称会包含 hash 值:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
dist/static/css/index.7879e19d.css
|
18
|
+
dist/static/js/index.18a568e5.js
|
19
|
+
```
|
20
|
+
|
21
|
+
你可以将 `output.filenameHash` 设置为 false 来禁用这个行为:
|
22
|
+
|
23
|
+
```js
|
24
|
+
export default {
|
25
|
+
output: {
|
26
|
+
filenameHash: false,
|
27
|
+
},
|
28
|
+
};
|
29
|
+
```
|
30
|
+
|
31
|
+
重新构建,产物的名称变为:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
dist/static/css/index.css
|
35
|
+
dist/static/js/index.js
|
36
|
+
```
|
37
|
+
|
38
|
+
详细用法可参考 [Rsbuild - output.filenameHash](https://rsbuild.dev/zh/config/output/filename-hash)。
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
sidebar_label: decorators
|
3
|
+
---
|
4
|
+
|
5
|
+
# source.decorators
|
6
|
+
|
7
|
+
- **类型:**
|
8
|
+
```
|
9
|
+
type Decorators = {
|
10
|
+
version?: 'legacy' | '2022-03';
|
11
|
+
};
|
12
|
+
```
|
13
|
+
|
14
|
+
- **默认值:**
|
15
|
+
|
16
|
+
```
|
17
|
+
type Decorators = {
|
18
|
+
version: 'legacy',
|
19
|
+
};
|
20
|
+
```
|
21
|
+
|
22
|
+
用于配置装饰器语法。
|
23
|
+
|
24
|
+
### 示例
|
25
|
+
|
26
|
+
Modern.js 默认使用 `legacy` 语法(Stage 1 提案),等价于 TypeScript 的 `experimentalDecorators: true`。
|
27
|
+
|
28
|
+
如果希望将装饰器语法调整成 Stage 3 提案,可以将 decorators.version 设置成 `2022-03`:
|
29
|
+
|
30
|
+
```js
|
31
|
+
export default {
|
32
|
+
source: {
|
33
|
+
decorators: {
|
34
|
+
version: '2022-03',
|
35
|
+
},
|
36
|
+
},
|
37
|
+
};
|
38
|
+
```
|
39
|
+
|
40
|
+
详细用法可参考 [Rsbuild - source.decorators](https://rsbuild.dev/zh/config/source/decorators)。
|
package/package.json
CHANGED
@@ -15,17 +15,17 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20240307170627",
|
19
19
|
"publishConfig": {
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
21
21
|
"access": "public",
|
22
22
|
"provenance": true
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@modern-js/sandpack-react": "0.0.0-nightly-
|
25
|
+
"@modern-js/sandpack-react": "0.0.0-nightly-20240307170627"
|
26
26
|
},
|
27
27
|
"peerDependencies": {
|
28
|
-
"@modern-js/builder-doc": "0.0.0-nightly-
|
28
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240307170627"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
31
|
"classnames": "^2",
|
@@ -35,12 +35,12 @@
|
|
35
35
|
"ts-node": "^10.9.1",
|
36
36
|
"typescript": "^5",
|
37
37
|
"fs-extra": "^10",
|
38
|
-
"rspress": "1.13.
|
39
|
-
"@rspress/shared": "1.13.
|
38
|
+
"rspress": "1.13.2",
|
39
|
+
"@rspress/shared": "1.13.2",
|
40
40
|
"@types/node": "^16",
|
41
41
|
"@types/fs-extra": "9.0.13",
|
42
|
-
"@modern-js/
|
43
|
-
"@modern-js/doc
|
42
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240307170627",
|
43
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240307170627"
|
44
44
|
},
|
45
45
|
"scripts": {
|
46
46
|
"dev": "rspress dev",
|