@modern-js/module-tools-docs 2.0.0-beta.4 → 2.0.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/.eslintrc.js +13 -0
- package/docs/en/api/config/_category_.json +4 -0
- package/docs/en/api/{build-config.md → config/build-config.md} +198 -105
- package/docs/en/api/{build-preset.md → config/build-preset.md} +65 -46
- package/docs/{zh/api → en/api/config}/design-system.md +130 -127
- package/docs/en/api/config/plugins.md +18 -0
- package/docs/en/api/{test.md → config/testing.md} +21 -12
- package/docs/en/api/index.md +3 -1
- package/docs/en/api/plugin-api/_category_.json +4 -0
- package/docs/en/api/plugin-api/plugin-hooks.md +501 -0
- package/docs/en/guide/advance/_category_.json +4 -0
- package/docs/en/guide/advance/asset.mdx +47 -30
- package/docs/en/guide/advance/build-umd.mdx +88 -80
- package/docs/en/guide/advance/copy.md +31 -28
- package/docs/en/guide/advance/external-dependency.mdx +27 -23
- package/docs/en/guide/advance/in-depth-about-build.md +56 -50
- package/docs/en/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/en/guide/advance/theme-config.mdx +80 -0
- package/docs/en/guide/basic/_category_.json +4 -0
- package/docs/en/guide/basic/before-getting-started.md +28 -23
- package/docs/en/guide/basic/command-preview.md +18 -14
- package/docs/en/guide/basic/modify-output-product.md +27 -20
- package/docs/en/guide/basic/publish-your-project.md +21 -19
- package/docs/en/guide/basic/test-your-project.mdx +19 -16
- package/docs/en/guide/basic/use-micro-generator.md +10 -7
- package/docs/en/guide/basic/using-storybook.mdx +27 -26
- package/docs/en/guide/best-practices/_category_.json +4 -0
- package/docs/en/guide/best-practices/components.mdx +783 -0
- package/docs/en/guide/intro/_category_.json +4 -0
- package/docs/en/guide/intro/getting-started.md +9 -4
- package/docs/en/guide/intro/welcome.md +4 -0
- package/docs/en/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/en/index.md +3 -5
- package/docs/en/plugins/guide/_category_.json +4 -0
- package/docs/en/plugins/guide/getting-started.mdx +84 -0
- package/docs/en/plugins/guide/plugin-object.mdx +85 -0
- package/docs/en/plugins/guide/setup-function.mdx +117 -0
- package/docs/en/plugins/official-list/_category_.json +4 -0
- package/docs/en/plugins/official-list/overview.md +6 -0
- package/docs/zh/api/config/_category_.json +4 -0
- package/docs/zh/api/config/build-config.md +658 -0
- package/docs/zh/api/{build-preset.md → config/build-preset.md} +49 -36
- package/docs/zh/api/config/design-system.md +1166 -0
- package/docs/zh/api/config/plugins.md +18 -0
- package/docs/zh/api/{testing.md → config/testing.md} +18 -13
- package/docs/zh/api/index.md +4 -1
- package/docs/zh/api/plugin-api/_category_.json +4 -0
- package/docs/zh/api/plugin-api/plugin-hooks.md +500 -0
- package/docs/zh/guide/advance/_category_.json +4 -0
- package/docs/zh/guide/advance/asset.mdx +47 -30
- package/docs/zh/guide/advance/build-umd.mdx +88 -71
- package/docs/zh/guide/advance/copy.md +31 -28
- package/docs/zh/guide/advance/external-dependency.mdx +27 -23
- package/docs/zh/guide/advance/in-depth-about-build.md +55 -50
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/zh/guide/advance/theme-config.mdx +78 -0
- package/docs/zh/guide/basic/_category_.json +4 -0
- package/docs/zh/guide/basic/before-getting-started.md +27 -22
- package/docs/zh/guide/basic/command-preview.md +17 -13
- package/docs/zh/guide/basic/modify-output-product.md +28 -21
- package/docs/zh/guide/basic/publish-your-project.md +22 -17
- package/docs/zh/guide/basic/test-your-project.mdx +20 -16
- package/docs/zh/guide/basic/use-micro-generator.md +10 -7
- package/docs/zh/guide/basic/using-storybook.mdx +27 -24
- package/docs/zh/guide/best-practices/_category_.json +4 -0
- package/docs/zh/guide/best-practices/components.mdx +793 -0
- package/docs/zh/guide/intro/_category_.json +4 -0
- package/docs/zh/guide/intro/getting-started.md +10 -4
- package/docs/zh/guide/intro/welcome.md +4 -0
- package/docs/zh/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/zh/index.md +3 -2
- package/docs/zh/plugins/guide/_category_.json +4 -0
- package/docs/zh/plugins/guide/getting-started.mdx +84 -0
- package/docs/zh/plugins/guide/plugin-object.mdx +85 -0
- package/docs/zh/plugins/guide/setup-function.mdx +117 -0
- package/docs/zh/plugins/official-list/_category_.json +4 -0
- package/docs/zh/plugins/official-list/overview.md +5 -0
- package/modern.config.ts +118 -0
- package/package.json +8 -6
- package/{docs/.island/styles → theme}/index.css +0 -1
- package/theme/index.ts +4 -0
- package/tsconfig.json +7 -0
- package/docs/.island/config.ts +0 -245
- package/docs/.island/dist/404.html +0 -41
- package/docs/.island/dist/assets/before-getting-started.1b82b538.js +0 -87
- package/docs/.island/dist/assets/before-getting-started.582a31cc.js +0 -87
- package/docs/.island/dist/assets/build-config.72eb0918.js +0 -804
- package/docs/.island/dist/assets/build-config.d8bb1658.js +0 -809
- package/docs/.island/dist/assets/build-preset.96805d7d.js +0 -256
- package/docs/.island/dist/assets/build-preset.c20dcd40.js +0 -256
- package/docs/.island/dist/assets/build-your-ui.7f349247.js +0 -2
- package/docs/.island/dist/assets/build-your-ui.a8361604.js +0 -2
- package/docs/.island/dist/assets/command-preview.2d45fc82.js +0 -264
- package/docs/.island/dist/assets/command-preview.dc51b953.js +0 -264
- package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
- package/docs/.island/dist/assets/design-system.86694ff5.js +0 -1254
- package/docs/.island/dist/assets/design-system.c4745cce.js +0 -639
- package/docs/.island/dist/assets/dev.1d326a37.js +0 -37
- package/docs/.island/dist/assets/dev.1fd06000.js +0 -37
- package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
- package/docs/.island/dist/assets/extension.12299fd6.js +0 -2
- package/docs/.island/dist/assets/extension.96dc63a4.js +0 -2
- package/docs/.island/dist/assets/getting-started.40e9218d.js +0 -117
- package/docs/.island/dist/assets/getting-started.b1ed3f10.js +0 -114
- package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
- package/docs/.island/dist/assets/index.2b2347ea.js +0 -33
- package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
- package/docs/.island/dist/assets/index.cb118238.js +0 -36
- package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
- package/docs/.island/dist/assets/island_inject.11a12ecc.js +0 -1
- package/docs/.island/dist/assets/island_inject.b13deaee.js +0 -1
- package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
- package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +0 -100
- package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +0 -100
- package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
- package/docs/.island/dist/assets/plugin.895932d8.js +0 -42
- package/docs/.island/dist/assets/plugin.d2fbc531.js +0 -42
- package/docs/.island/dist/assets/publish-your-project.21b8309f.js +0 -164
- package/docs/.island/dist/assets/publish-your-project.8d398b17.js +0 -166
- package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
- package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
- package/docs/.island/dist/assets/search.1c85d17c.js +0 -3
- package/docs/.island/dist/assets/search.484eca11.js +0 -222
- package/docs/.island/dist/assets/search.54fca8d0.js +0 -3
- package/docs/.island/dist/assets/style.09015a4b.css +0 -1
- package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
- package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
- package/docs/.island/dist/assets/test-your-project.18bd4582.js +0 -190
- package/docs/.island/dist/assets/test-your-project.f53bebf7.js +0 -190
- package/docs/.island/dist/assets/test.0da1f99f.js +0 -67
- package/docs/.island/dist/assets/test.0e81f002.js +0 -66
- package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
- package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +0 -60
- package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +0 -60
- package/docs/.island/dist/assets/using-storybook.57ea6b77.js +0 -260
- package/docs/.island/dist/assets/using-storybook.a2212f2e.js +0 -260
- package/docs/.island/dist/assets/welcome.0449a9c8.js +0 -13
- package/docs/.island/dist/assets/welcome.a8448931.js +0 -13
- package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +0 -26
- package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +0 -26
- package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
- package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
- package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
- package/docs/.island/dist/client-entry.js +0 -3
- package/docs/.island/dist/en/api/build-config.html +0 -344
- package/docs/.island/dist/en/api/build-preset.html +0 -82
- package/docs/.island/dist/en/api/design-system.html +0 -155
- package/docs/.island/dist/en/api/dev.html +0 -45
- package/docs/.island/dist/en/api/index.html +0 -41
- package/docs/.island/dist/en/api/plugin.html +0 -48
- package/docs/.island/dist/en/api/test.html +0 -58
- package/docs/.island/dist/en/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/en/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/en/guide/command-preview.html +0 -100
- package/docs/.island/dist/en/guide/extension.html +0 -41
- package/docs/.island/dist/en/guide/getting-started.html +0 -76
- package/docs/.island/dist/en/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/en/guide/publish-your-project.html +0 -91
- package/docs/.island/dist/en/guide/test-your-project.html +0 -72
- package/docs/.island/dist/en/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/en/guide/using-storybook.html +0 -113
- package/docs/.island/dist/en/guide/welcome.html +0 -53
- package/docs/.island/dist/en/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/en/index.html +0 -42
- package/docs/.island/dist/react-dom.js +0 -1
- package/docs/.island/dist/react-dom_client.js +0 -1
- package/docs/.island/dist/react.js +0 -1
- package/docs/.island/dist/react_jsx-runtime.js +0 -10
- package/docs/.island/dist/ssr-manifest.json +0 -57
- package/docs/.island/dist/test-result.png +0 -0
- package/docs/.island/dist/why-module-solution.png +0 -0
- package/docs/.island/dist/zh/api/build-config.html +0 -347
- package/docs/.island/dist/zh/api/build-preset.html +0 -82
- package/docs/.island/dist/zh/api/design-system.html +0 -149
- package/docs/.island/dist/zh/api/dev.html +0 -46
- package/docs/.island/dist/zh/api/index.html +0 -41
- package/docs/.island/dist/zh/api/plugin.html +0 -48
- package/docs/.island/dist/zh/api/test.html +0 -59
- package/docs/.island/dist/zh/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/zh/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/zh/guide/command-preview.html +0 -100
- package/docs/.island/dist/zh/guide/extension.html +0 -41
- package/docs/.island/dist/zh/guide/getting-started.html +0 -79
- package/docs/.island/dist/zh/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/zh/guide/publish-your-project.html +0 -92
- package/docs/.island/dist/zh/guide/test-your-project.html +0 -72
- package/docs/.island/dist/zh/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/zh/guide/using-storybook.html +0 -114
- package/docs/.island/dist/zh/guide/welcome.html +0 -53
- package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/zh/index.html +0 -42
- package/docs/.island/index.html +0 -39
- package/docs/en/api/design-system.md +0 -524
- package/docs/en/api/dev.md +0 -32
- package/docs/en/api/plugin.md +0 -34
- package/docs/zh/api/build-config.md +0 -570
- package/docs/zh/api/dev.md +0 -33
- package/docs/zh/api/plugins.md +0 -108
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# BuildPreset
|
|
2
|
-
|
|
6
|
+
|
|
7
|
+
构建的预设字符串或者预设函数。提供开箱即用的构建配置。
|
|
3
8
|
|
|
4
9
|
- type: `string | Function`
|
|
5
10
|
- default: `undefined`
|
|
6
11
|
|
|
7
|
-
|
|
8
12
|
## string
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
字符串的形式可以让你直接使用内置的预设。
|
|
11
15
|
|
|
12
|
-
```
|
|
16
|
+
```js modern.config.ts
|
|
13
17
|
import { defineConfig } from '@modern-js/module-tools';
|
|
14
18
|
|
|
15
19
|
export default defineConfig({
|
|
@@ -17,42 +21,45 @@ export default defineConfig({
|
|
|
17
21
|
});
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
|
|
21
24
|
### `'npm-library'`
|
|
25
|
+
|
|
22
26
|
在类 [NPM](https://www.npmjs.com/) 包管理器下使用的 Library 通用模式,包含 `esm` 和 `cjs` 两种 Bundle 产物,并且包含一份类型文件。
|
|
23
27
|
|
|
24
28
|
:::info
|
|
25
29
|
关于类 [NPM](https://www.npmjs.com/) 包管理器
|
|
26
|
-
* [npm](https://www.npmjs.com)
|
|
27
|
-
* [yarn](https://yarnpkg.com/)
|
|
28
|
-
* [pnpm](https://pnpm.io/)
|
|
29
|
-
:::
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
- [npm](https://www.npmjs.com)
|
|
32
|
+
- [yarn](https://yarnpkg.com/)
|
|
33
|
+
- [pnpm](https://pnpm.io/)
|
|
34
|
+
:::
|
|
35
|
+
|
|
36
|
+
```json package.json
|
|
32
37
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
"main": "./dist/lib/index.js",
|
|
39
|
+
"module": "./dist/es/index.js",
|
|
40
|
+
"types": "./dist/types/index.d.ts"
|
|
36
41
|
}
|
|
37
42
|
```
|
|
43
|
+
|
|
38
44
|
预设字符串对应的构建配置:
|
|
45
|
+
|
|
39
46
|
```js
|
|
40
47
|
export const buildConfig = [
|
|
41
48
|
{
|
|
42
49
|
format: 'cjs',
|
|
43
50
|
target: 'es6',
|
|
44
51
|
buildType: 'bundle',
|
|
45
|
-
|
|
52
|
+
outDir: './lib',
|
|
46
53
|
},
|
|
47
54
|
{
|
|
48
55
|
format: 'esm',
|
|
49
56
|
target: 'es6',
|
|
50
57
|
buildType: 'bundle',
|
|
51
|
-
|
|
58
|
+
outDir: './es',
|
|
52
59
|
},
|
|
53
60
|
{
|
|
54
61
|
buildType: 'bundle',
|
|
55
|
-
|
|
62
|
+
outDir: './types',
|
|
56
63
|
dts: {
|
|
57
64
|
only: true,
|
|
58
65
|
},
|
|
@@ -61,9 +68,10 @@ export const buildConfig = [
|
|
|
61
68
|
```
|
|
62
69
|
|
|
63
70
|
### `'npm-library-with-umd'`
|
|
71
|
+
|
|
64
72
|
在类 [NPM](https://www.npmjs.com/) 包管理器下使用,并且 Library 支持类似 [unpkg](https://unpkg.com/) 的模式。在预设 `'npm-library'` 的基础上,额外提供 `umd` 产物。
|
|
65
73
|
|
|
66
|
-
```json
|
|
74
|
+
```json package.json
|
|
67
75
|
{
|
|
68
76
|
"main": "./dist/lib/index.js",
|
|
69
77
|
"module": "./dist/es/index.js",
|
|
@@ -71,30 +79,32 @@ export const buildConfig = [
|
|
|
71
79
|
"unpkg": "./dist/umd/index.js",
|
|
72
80
|
};
|
|
73
81
|
```
|
|
82
|
+
|
|
74
83
|
预设字符串对应的构建配置:
|
|
84
|
+
|
|
75
85
|
```js
|
|
76
86
|
export const buildConfig = [
|
|
77
87
|
{
|
|
78
88
|
format: 'cjs',
|
|
79
89
|
target: 'es6',
|
|
80
90
|
buildType: 'bundle',
|
|
81
|
-
|
|
91
|
+
outDir: './lib',
|
|
82
92
|
},
|
|
83
93
|
{
|
|
84
94
|
format: 'esm',
|
|
85
95
|
target: 'es6',
|
|
86
96
|
buildType: 'bundle',
|
|
87
|
-
|
|
97
|
+
outDir: './es',
|
|
88
98
|
},
|
|
89
99
|
{
|
|
90
100
|
format: 'umd',
|
|
91
101
|
target: 'es6',
|
|
92
102
|
buildType: 'bundle',
|
|
93
|
-
|
|
103
|
+
outDir: './umd',
|
|
94
104
|
},
|
|
95
105
|
{
|
|
96
106
|
buildType: 'bundle',
|
|
97
|
-
|
|
107
|
+
outDir: './types',
|
|
98
108
|
dts: {
|
|
99
109
|
only: true,
|
|
100
110
|
},
|
|
@@ -103,36 +113,38 @@ export const buildConfig = [
|
|
|
103
113
|
```
|
|
104
114
|
|
|
105
115
|
### `'npm-component'`
|
|
106
|
-
|
|
116
|
+
|
|
117
|
+
在类 [NPM](https://www.npmjs.com/) 包管理器下使用的 组件(库)通用模式。包含 `esm` 和 `cjs` 两种 Bundleless 产物(便于 _[Tree shaking](https://developer.mozilla.org/zh-CN/docs/Glossary/Tree_shaking)_ 优化),以及包含一份类型文件。
|
|
107
118
|
|
|
108
119
|
对于源码中包含的样式文件,产物中提供样式的编译产物和样式的源文件。
|
|
109
120
|
|
|
110
|
-
```json
|
|
121
|
+
```json package.json
|
|
111
122
|
{
|
|
112
123
|
"main": "./dist/lib/index.js", // bundleless type
|
|
113
124
|
"module": "./dist/es/index.js", // bundleless type
|
|
114
125
|
"types": "./dist/types/index.d.ts",
|
|
115
126
|
};
|
|
116
127
|
```
|
|
128
|
+
|
|
117
129
|
预设字符串对应的构建配置:
|
|
118
130
|
|
|
119
|
-
```
|
|
131
|
+
```js
|
|
120
132
|
export const buildConfig = [
|
|
121
133
|
{
|
|
122
134
|
format: 'cjs',
|
|
123
135
|
target: 'es6',
|
|
124
136
|
buildType: 'bundleless',
|
|
125
|
-
|
|
137
|
+
outDir: './lib',
|
|
126
138
|
},
|
|
127
139
|
{
|
|
128
140
|
format: 'esm',
|
|
129
141
|
target: 'es6',
|
|
130
142
|
buildType: 'bundleless',
|
|
131
|
-
|
|
143
|
+
outDir: './es',
|
|
132
144
|
},
|
|
133
145
|
{
|
|
134
146
|
buildType: 'bundleless',
|
|
135
|
-
|
|
147
|
+
outDir: './types',
|
|
136
148
|
dts: {
|
|
137
149
|
only: true,
|
|
138
150
|
},
|
|
@@ -143,7 +155,8 @@ export const buildConfig = [
|
|
|
143
155
|
### `'npm-component-with-umd'`
|
|
144
156
|
|
|
145
157
|
在类 [NPM](https://www.npmjs.com/) 包管理器下使用的组件(库),同时支持类 [unpkg](https://unpkg.com/) 的模式。 在预设 `'npm-component'` 的基础上,额外提供 `umd` 产物。
|
|
146
|
-
|
|
158
|
+
|
|
159
|
+
```json package.json
|
|
147
160
|
{
|
|
148
161
|
"main": "./dist/lib/index.js", // bundleless type
|
|
149
162
|
"module": "./dist/es/index.js", // bundleless type
|
|
@@ -151,29 +164,30 @@ export const buildConfig = [
|
|
|
151
164
|
"unpkg": "./dist/umd/index.js",
|
|
152
165
|
};
|
|
153
166
|
```
|
|
167
|
+
|
|
154
168
|
```js
|
|
155
169
|
export const buildConfig = [
|
|
156
170
|
{
|
|
157
171
|
format: 'cjs',
|
|
158
172
|
target: 'es6',
|
|
159
173
|
buildType: 'bundleless',
|
|
160
|
-
|
|
174
|
+
outDir: './lib',
|
|
161
175
|
},
|
|
162
176
|
{
|
|
163
177
|
format: 'esm',
|
|
164
178
|
target: 'es6',
|
|
165
179
|
buildType: 'bundleless',
|
|
166
|
-
|
|
180
|
+
outDir: './es',
|
|
167
181
|
},
|
|
168
|
-
|
|
182
|
+
{
|
|
169
183
|
format: 'umd',
|
|
170
184
|
target: 'es6',
|
|
171
185
|
buildType: 'bundle',
|
|
172
|
-
|
|
186
|
+
outDir: './umd',
|
|
173
187
|
},
|
|
174
188
|
{
|
|
175
189
|
buildType: 'bundleless',
|
|
176
|
-
|
|
190
|
+
outDir: './types',
|
|
177
191
|
dts: {
|
|
178
192
|
only: true,
|
|
179
193
|
},
|
|
@@ -183,12 +197,11 @@ export const buildConfig = [
|
|
|
183
197
|
|
|
184
198
|
### 关于预设值支持的 ECMAScript 版本以及 `{es5...esnext}`
|
|
185
199
|
|
|
186
|
-
|
|
187
200
|
当想要使用支持其他 ECMAScript 版本的 `buildPreset` 预设的时候,可以直接在 `'npm-library'`、`'npm-library-with-umd'`、`'npm-component'`、`'npm-component-with-umd'` 这些预设值后面增加想要支持的版本。
|
|
188
201
|
|
|
189
202
|
例如希望 `'npm-library'` 预设支持 `es2017`,则可以按照如下方式配置:
|
|
190
203
|
|
|
191
|
-
```
|
|
204
|
+
```js modern.config.ts
|
|
192
205
|
import { defineConfig } from '@modern-js/module-tools';
|
|
193
206
|
|
|
194
207
|
export default defineConfig({
|
|
@@ -201,7 +214,7 @@ export default defineConfig({
|
|
|
201
214
|
函数的配置方式,可以通过 `preset` 参数获取到预设值,然后对里面的构建配置进行修改来自定义你的构建配置。
|
|
202
215
|
以下是一个函数的配置方式的例子,它配置了压缩构建产物的功能:
|
|
203
216
|
|
|
204
|
-
```js
|
|
217
|
+
```js modern.config.ts
|
|
205
218
|
import { defineConfig } from '@modern-js/module-tools';
|
|
206
219
|
|
|
207
220
|
export default defineConfig({
|