@modern-js/module-tools-docs 2.46.0 → 2.46.1
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/CHANGELOG.md +2 -0
- package/docs/en/api/config/build-config.mdx +5 -2
- package/docs/en/guide/faq/basic.mdx +13 -0
- package/docs/en/guide/faq/index.md +1 -0
- package/docs/zh/api/config/build-config.mdx +5 -2
- package/docs/zh/guide/faq/basic.mdx +12 -0
- package/docs/zh/guide/faq/index.md +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -134,14 +134,17 @@ export default () => <Logo />;
|
|
|
134
134
|
|
|
135
135
|
:::
|
|
136
136
|
|
|
137
|
-
When enabled, the type of svg used can be modified by
|
|
137
|
+
When enabled, the type of svg used can be modified by initing a new declaration file and adding to the `modern-app-env.d.ts`:
|
|
138
138
|
|
|
139
|
-
```ts title="
|
|
139
|
+
```ts title="your-app-env.d.ts"
|
|
140
140
|
declare module '*.svg' {
|
|
141
141
|
const src: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
142
142
|
export default src;
|
|
143
143
|
}
|
|
144
|
+
```
|
|
144
145
|
|
|
146
|
+
```ts title="modern-app-env.d.ts"
|
|
147
|
+
/// <reference path='./your-app-env.d.ts' />
|
|
145
148
|
/// <reference types='@modern-js/module-tools/types' />
|
|
146
149
|
```
|
|
147
150
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# General Questions
|
|
2
|
+
|
|
3
|
+
## What is the relationship between Modern.js Module and Rsbuild?
|
|
4
|
+
|
|
5
|
+
Modern.js Module uses esbuild to build toolkits and component libraries, and Rsbuild focuses on solving web application building scenarios.
|
|
6
|
+
|
|
7
|
+
## Can Modern.js Module use webpack plugins or loaders?
|
|
8
|
+
|
|
9
|
+
Modern.js Module is based on esbuild for building and cannot use tools from the webpack-related ecosystem.
|
|
10
|
+
You can find more community plugins for esbuild [here](https://github.com/esbuild/community-plugins)
|
|
11
|
+
|
|
12
|
+
If the UMD product produced by Modern.js Module does not meet your requirements, you can use Rsbuild and add [UMD Plugin](https://rsbuild.dev/plugins/list/plugin-umd) to build UMD products.
|
|
13
|
+
|
|
@@ -132,14 +132,17 @@ import Logo from './logo.svg';
|
|
|
132
132
|
export default () => <Logo />;
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
当开启功能后,可以新建一个类型描述文件,并在 `modern-app-env.d.ts` 文件中增加,修改使用 SVG 的类型:
|
|
136
136
|
|
|
137
|
-
```ts title="
|
|
137
|
+
```ts title="your-app-env.d.ts"
|
|
138
138
|
declare module '*.svg' {
|
|
139
139
|
const src: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
140
140
|
export default src;
|
|
141
141
|
}
|
|
142
|
+
```
|
|
142
143
|
|
|
144
|
+
```ts title="modern-app-env.d.ts"
|
|
145
|
+
/// <reference path='./your-app-env.d.ts' />
|
|
143
146
|
/// <reference types='@modern-js/module-tools/types' />
|
|
144
147
|
```
|
|
145
148
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 通用类问题
|
|
2
|
+
|
|
3
|
+
## Modern.js Module 和 Rsbuild 的关系?
|
|
4
|
+
|
|
5
|
+
Modern.js Module 使用 esbuild 构建工具库和组件库,Rsbuild 专注于解决 Web 应用构建场景。
|
|
6
|
+
|
|
7
|
+
## Modern.js Module 是否可以使用 webpack plugin 或者 loader?
|
|
8
|
+
|
|
9
|
+
Modern.js Module 基于 esbuild 构建,无法使用 webpack 相关生态的工具。
|
|
10
|
+
[这里](https://github.com/esbuild/community-plugins)可以发现更多 esbuild 社区插件
|
|
11
|
+
|
|
12
|
+
如果 Modern.js Module 生产的 UMD 产物达不到你的要求,可以使用 Rsbuild 并添加 [UMD Plugin](https://rsbuild.dev/zh/plugins/list/plugin-umd) 构建 UMD 产物。
|
package/package.json
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"directory": "packages/document/module-doc"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "2.46.
|
|
12
|
+
"version": "2.46.1",
|
|
13
13
|
"main": "index.js",
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"react": "^18.2.0",
|
|
16
16
|
"react-dom": "^18.2.0",
|
|
17
|
-
"rspress": "1.
|
|
18
|
-
"@rspress/shared": "1.
|
|
19
|
-
"@modern-js/doc-plugin-auto-sidebar": "2.46.
|
|
17
|
+
"rspress": "1.10.0",
|
|
18
|
+
"@rspress/shared": "1.10.0",
|
|
19
|
+
"@modern-js/doc-plugin-auto-sidebar": "2.46.1"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "rspress dev",
|