@modern-js/main-doc 2.62.1 → 2.63.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,10 +8,12 @@ configName: output.sourceMap
8
8
  - **Type:**
9
9
 
10
10
  ```ts
11
- type SourceMap = {
12
- js?: Rspack.Configuration['devtool'];
13
- css?: boolean;
14
- };
11
+ type SourceMap =
12
+ | boolean
13
+ | {
14
+ js?: Rspack.Configuration['devtool'];
15
+ css?: boolean;
16
+ };
15
17
  ```
16
18
 
17
19
  - **Default:**
@@ -258,4 +258,8 @@ export default () => {
258
258
 
259
259
  import ExtendBFF from "@site-docs-en/components/extend-bff-function"
260
260
 
261
- <ExtendBFF/>
261
+ <ExtendBFF/>
262
+
263
+ ## Code Sharing
264
+
265
+ Besides the BFF functions in the `api/` directory, which can be referenced in the `src/` directory through an integrated calling method, the `src/` and `api/` directories cannot directly reference each other's code by default. To achieve code sharing, a [`shared`](/en/apis/app/hooks/shared.html) directory can be created at the root of the project for both `src/` and `api/` to use commonly.
@@ -8,10 +8,12 @@ configName: output.sourceMap
8
8
  - **类型:**
9
9
 
10
10
  ```ts
11
- type SourceMap = {
12
- js?: Rspack.Configuration['devtool'];
13
- css?: boolean;
14
- };
11
+ type SourceMap =
12
+ | boolean
13
+ | {
14
+ js?: Rspack.Configuration['devtool'];
15
+ css?: boolean;
16
+ };
15
17
  ```
16
18
 
17
19
  - **默认值:**
@@ -260,4 +260,8 @@ export default () => {
260
260
 
261
261
  import ExtendBFF from "@site-docs/components/extend-bff-function"
262
262
 
263
- <ExtendBFF/>
263
+ <ExtendBFF/>
264
+
265
+ ## 代码共享
266
+
267
+ 除 `api/` 目录下的 BFF 函数可在 `src/` 中通过一体化调用方式引用,项目中 `src/` 和 `api/` 目录默认不能直接引用对方代码。为实现代码共享,可在项目根目录创建 [`shared`](/apis/app/hooks/shared.html) 目录,供 `src/` 和 `api/` 共同引用。
package/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.62.1",
18
+ "version": "2.63.1",
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": "2.62.1"
25
+ "@modern-js/sandpack-react": "2.63.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rspress/shared": "1.35.4",