@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.
Files changed (198) hide show
  1. package/.eslintrc.js +13 -0
  2. package/docs/en/api/config/_category_.json +4 -0
  3. package/docs/en/api/{build-config.md → config/build-config.md} +198 -105
  4. package/docs/en/api/{build-preset.md → config/build-preset.md} +65 -46
  5. package/docs/{zh/api → en/api/config}/design-system.md +130 -127
  6. package/docs/en/api/config/plugins.md +18 -0
  7. package/docs/en/api/{test.md → config/testing.md} +21 -12
  8. package/docs/en/api/index.md +3 -1
  9. package/docs/en/api/plugin-api/_category_.json +4 -0
  10. package/docs/en/api/plugin-api/plugin-hooks.md +501 -0
  11. package/docs/en/guide/advance/_category_.json +4 -0
  12. package/docs/en/guide/advance/asset.mdx +47 -30
  13. package/docs/en/guide/advance/build-umd.mdx +88 -80
  14. package/docs/en/guide/advance/copy.md +31 -28
  15. package/docs/en/guide/advance/external-dependency.mdx +27 -23
  16. package/docs/en/guide/advance/in-depth-about-build.md +56 -50
  17. package/docs/en/guide/advance/in-depth-about-dev-command.md +7 -4
  18. package/docs/en/guide/advance/theme-config.mdx +80 -0
  19. package/docs/en/guide/basic/_category_.json +4 -0
  20. package/docs/en/guide/basic/before-getting-started.md +28 -23
  21. package/docs/en/guide/basic/command-preview.md +18 -14
  22. package/docs/en/guide/basic/modify-output-product.md +27 -20
  23. package/docs/en/guide/basic/publish-your-project.md +21 -19
  24. package/docs/en/guide/basic/test-your-project.mdx +19 -16
  25. package/docs/en/guide/basic/use-micro-generator.md +10 -7
  26. package/docs/en/guide/basic/using-storybook.mdx +27 -26
  27. package/docs/en/guide/best-practices/_category_.json +4 -0
  28. package/docs/en/guide/best-practices/components.mdx +783 -0
  29. package/docs/en/guide/intro/_category_.json +4 -0
  30. package/docs/en/guide/intro/getting-started.md +9 -4
  31. package/docs/en/guide/intro/welcome.md +4 -0
  32. package/docs/en/guide/intro/why-module-engineering-solution.md +5 -1
  33. package/docs/en/index.md +3 -5
  34. package/docs/en/plugins/guide/_category_.json +4 -0
  35. package/docs/en/plugins/guide/getting-started.mdx +84 -0
  36. package/docs/en/plugins/guide/plugin-object.mdx +85 -0
  37. package/docs/en/plugins/guide/setup-function.mdx +117 -0
  38. package/docs/en/plugins/official-list/_category_.json +4 -0
  39. package/docs/en/plugins/official-list/overview.md +6 -0
  40. package/docs/zh/api/config/_category_.json +4 -0
  41. package/docs/zh/api/config/build-config.md +658 -0
  42. package/docs/zh/api/{build-preset.md → config/build-preset.md} +49 -36
  43. package/docs/zh/api/config/design-system.md +1166 -0
  44. package/docs/zh/api/config/plugins.md +18 -0
  45. package/docs/zh/api/{testing.md → config/testing.md} +18 -13
  46. package/docs/zh/api/index.md +4 -1
  47. package/docs/zh/api/plugin-api/_category_.json +4 -0
  48. package/docs/zh/api/plugin-api/plugin-hooks.md +500 -0
  49. package/docs/zh/guide/advance/_category_.json +4 -0
  50. package/docs/zh/guide/advance/asset.mdx +47 -30
  51. package/docs/zh/guide/advance/build-umd.mdx +88 -71
  52. package/docs/zh/guide/advance/copy.md +31 -28
  53. package/docs/zh/guide/advance/external-dependency.mdx +27 -23
  54. package/docs/zh/guide/advance/in-depth-about-build.md +55 -50
  55. package/docs/zh/guide/advance/in-depth-about-dev-command.md +7 -4
  56. package/docs/zh/guide/advance/theme-config.mdx +78 -0
  57. package/docs/zh/guide/basic/_category_.json +4 -0
  58. package/docs/zh/guide/basic/before-getting-started.md +27 -22
  59. package/docs/zh/guide/basic/command-preview.md +17 -13
  60. package/docs/zh/guide/basic/modify-output-product.md +28 -21
  61. package/docs/zh/guide/basic/publish-your-project.md +22 -17
  62. package/docs/zh/guide/basic/test-your-project.mdx +20 -16
  63. package/docs/zh/guide/basic/use-micro-generator.md +10 -7
  64. package/docs/zh/guide/basic/using-storybook.mdx +27 -24
  65. package/docs/zh/guide/best-practices/_category_.json +4 -0
  66. package/docs/zh/guide/best-practices/components.mdx +793 -0
  67. package/docs/zh/guide/intro/_category_.json +4 -0
  68. package/docs/zh/guide/intro/getting-started.md +10 -4
  69. package/docs/zh/guide/intro/welcome.md +4 -0
  70. package/docs/zh/guide/intro/why-module-engineering-solution.md +5 -1
  71. package/docs/zh/index.md +3 -2
  72. package/docs/zh/plugins/guide/_category_.json +4 -0
  73. package/docs/zh/plugins/guide/getting-started.mdx +84 -0
  74. package/docs/zh/plugins/guide/plugin-object.mdx +85 -0
  75. package/docs/zh/plugins/guide/setup-function.mdx +117 -0
  76. package/docs/zh/plugins/official-list/_category_.json +4 -0
  77. package/docs/zh/plugins/official-list/overview.md +5 -0
  78. package/modern.config.ts +118 -0
  79. package/package.json +8 -6
  80. package/{docs/.island/styles → theme}/index.css +0 -1
  81. package/theme/index.ts +4 -0
  82. package/tsconfig.json +7 -0
  83. package/docs/.island/config.ts +0 -245
  84. package/docs/.island/dist/404.html +0 -41
  85. package/docs/.island/dist/assets/before-getting-started.1b82b538.js +0 -87
  86. package/docs/.island/dist/assets/before-getting-started.582a31cc.js +0 -87
  87. package/docs/.island/dist/assets/build-config.72eb0918.js +0 -804
  88. package/docs/.island/dist/assets/build-config.d8bb1658.js +0 -809
  89. package/docs/.island/dist/assets/build-preset.96805d7d.js +0 -256
  90. package/docs/.island/dist/assets/build-preset.c20dcd40.js +0 -256
  91. package/docs/.island/dist/assets/build-your-ui.7f349247.js +0 -2
  92. package/docs/.island/dist/assets/build-your-ui.a8361604.js +0 -2
  93. package/docs/.island/dist/assets/command-preview.2d45fc82.js +0 -264
  94. package/docs/.island/dist/assets/command-preview.dc51b953.js +0 -264
  95. package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
  96. package/docs/.island/dist/assets/design-system.86694ff5.js +0 -1254
  97. package/docs/.island/dist/assets/design-system.c4745cce.js +0 -639
  98. package/docs/.island/dist/assets/dev.1d326a37.js +0 -37
  99. package/docs/.island/dist/assets/dev.1fd06000.js +0 -37
  100. package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
  101. package/docs/.island/dist/assets/extension.12299fd6.js +0 -2
  102. package/docs/.island/dist/assets/extension.96dc63a4.js +0 -2
  103. package/docs/.island/dist/assets/getting-started.40e9218d.js +0 -117
  104. package/docs/.island/dist/assets/getting-started.b1ed3f10.js +0 -114
  105. package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
  106. package/docs/.island/dist/assets/index.2b2347ea.js +0 -33
  107. package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
  108. package/docs/.island/dist/assets/index.cb118238.js +0 -36
  109. package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
  110. package/docs/.island/dist/assets/island_inject.11a12ecc.js +0 -1
  111. package/docs/.island/dist/assets/island_inject.b13deaee.js +0 -1
  112. package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
  113. package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +0 -100
  114. package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +0 -100
  115. package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
  116. package/docs/.island/dist/assets/plugin.895932d8.js +0 -42
  117. package/docs/.island/dist/assets/plugin.d2fbc531.js +0 -42
  118. package/docs/.island/dist/assets/publish-your-project.21b8309f.js +0 -164
  119. package/docs/.island/dist/assets/publish-your-project.8d398b17.js +0 -166
  120. package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
  121. package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
  122. package/docs/.island/dist/assets/search.1c85d17c.js +0 -3
  123. package/docs/.island/dist/assets/search.484eca11.js +0 -222
  124. package/docs/.island/dist/assets/search.54fca8d0.js +0 -3
  125. package/docs/.island/dist/assets/style.09015a4b.css +0 -1
  126. package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
  127. package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
  128. package/docs/.island/dist/assets/test-your-project.18bd4582.js +0 -190
  129. package/docs/.island/dist/assets/test-your-project.f53bebf7.js +0 -190
  130. package/docs/.island/dist/assets/test.0da1f99f.js +0 -67
  131. package/docs/.island/dist/assets/test.0e81f002.js +0 -66
  132. package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
  133. package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +0 -60
  134. package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +0 -60
  135. package/docs/.island/dist/assets/using-storybook.57ea6b77.js +0 -260
  136. package/docs/.island/dist/assets/using-storybook.a2212f2e.js +0 -260
  137. package/docs/.island/dist/assets/welcome.0449a9c8.js +0 -13
  138. package/docs/.island/dist/assets/welcome.a8448931.js +0 -13
  139. package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +0 -26
  140. package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +0 -26
  141. package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
  142. package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
  143. package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
  144. package/docs/.island/dist/client-entry.js +0 -3
  145. package/docs/.island/dist/en/api/build-config.html +0 -344
  146. package/docs/.island/dist/en/api/build-preset.html +0 -82
  147. package/docs/.island/dist/en/api/design-system.html +0 -155
  148. package/docs/.island/dist/en/api/dev.html +0 -45
  149. package/docs/.island/dist/en/api/index.html +0 -41
  150. package/docs/.island/dist/en/api/plugin.html +0 -48
  151. package/docs/.island/dist/en/api/test.html +0 -58
  152. package/docs/.island/dist/en/guide/before-getting-started.html +0 -127
  153. package/docs/.island/dist/en/guide/build-your-ui.html +0 -41
  154. package/docs/.island/dist/en/guide/command-preview.html +0 -100
  155. package/docs/.island/dist/en/guide/extension.html +0 -41
  156. package/docs/.island/dist/en/guide/getting-started.html +0 -76
  157. package/docs/.island/dist/en/guide/modify-output-product.html +0 -140
  158. package/docs/.island/dist/en/guide/publish-your-project.html +0 -91
  159. package/docs/.island/dist/en/guide/test-your-project.html +0 -72
  160. package/docs/.island/dist/en/guide/use-micro-generator.html +0 -65
  161. package/docs/.island/dist/en/guide/using-storybook.html +0 -113
  162. package/docs/.island/dist/en/guide/welcome.html +0 -53
  163. package/docs/.island/dist/en/guide/why-module-engineering-solution.html +0 -49
  164. package/docs/.island/dist/en/index.html +0 -42
  165. package/docs/.island/dist/react-dom.js +0 -1
  166. package/docs/.island/dist/react-dom_client.js +0 -1
  167. package/docs/.island/dist/react.js +0 -1
  168. package/docs/.island/dist/react_jsx-runtime.js +0 -10
  169. package/docs/.island/dist/ssr-manifest.json +0 -57
  170. package/docs/.island/dist/test-result.png +0 -0
  171. package/docs/.island/dist/why-module-solution.png +0 -0
  172. package/docs/.island/dist/zh/api/build-config.html +0 -347
  173. package/docs/.island/dist/zh/api/build-preset.html +0 -82
  174. package/docs/.island/dist/zh/api/design-system.html +0 -149
  175. package/docs/.island/dist/zh/api/dev.html +0 -46
  176. package/docs/.island/dist/zh/api/index.html +0 -41
  177. package/docs/.island/dist/zh/api/plugin.html +0 -48
  178. package/docs/.island/dist/zh/api/test.html +0 -59
  179. package/docs/.island/dist/zh/guide/before-getting-started.html +0 -127
  180. package/docs/.island/dist/zh/guide/build-your-ui.html +0 -41
  181. package/docs/.island/dist/zh/guide/command-preview.html +0 -100
  182. package/docs/.island/dist/zh/guide/extension.html +0 -41
  183. package/docs/.island/dist/zh/guide/getting-started.html +0 -79
  184. package/docs/.island/dist/zh/guide/modify-output-product.html +0 -140
  185. package/docs/.island/dist/zh/guide/publish-your-project.html +0 -92
  186. package/docs/.island/dist/zh/guide/test-your-project.html +0 -72
  187. package/docs/.island/dist/zh/guide/use-micro-generator.html +0 -65
  188. package/docs/.island/dist/zh/guide/using-storybook.html +0 -114
  189. package/docs/.island/dist/zh/guide/welcome.html +0 -53
  190. package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +0 -49
  191. package/docs/.island/dist/zh/index.html +0 -42
  192. package/docs/.island/index.html +0 -39
  193. package/docs/en/api/design-system.md +0 -524
  194. package/docs/en/api/dev.md +0 -32
  195. package/docs/en/api/plugin.md +0 -34
  196. package/docs/zh/api/build-config.md +0 -570
  197. package/docs/zh/api/dev.md +0 -33
  198. package/docs/zh/api/plugins.md +0 -108
@@ -1,56 +1,65 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
1
5
  # BuildPreset
6
+
2
7
  A build preset string or preset function. Provides out-of-the-box build configuration
3
8
 
4
9
  - type: `string | Function`
5
10
  - default: `undefined`
6
11
 
7
-
8
12
  ## string
9
13
 
10
14
  The string form allows you to use the built-in presets directly
11
15
 
12
- ```js
13
- export default {
16
+ ```js modern.config.ts
17
+ import { defineConfig } from '@modern-js/module-tools';
18
+
19
+ export default defineConfig({
14
20
  buildPreset: 'npm-library',
15
- };
21
+ });
16
22
  ```
17
23
 
18
-
19
24
  ### ``npm-library'`
25
+
20
26
  Library generic schema used under class [NPM](https://www.npmjs.com/) package manager, contains `esm` and `cjs` Bundle products, and includes a type file.
21
27
 
22
28
  :::info
23
29
  About the class [NPM](https://www.npmjs.com/) Package Manager
24
- * [npm](https://www.npmjs.com)
25
- * [yarn](https://yarnpkg.com/)
26
- * [pnpm](https://pnpm.io/)
27
- :::
28
30
 
29
- ```json title="package.json"
31
+ - [npm](https://www.npmjs.com)
32
+ - [yarn](https://yarnpkg.com/)
33
+ - [pnpm](https://pnpm.io/)
34
+ :::
35
+
36
+ ```json package.json
30
37
  {
31
- "main": ". /dist/lib/index.js",
32
- "module": ". /dist/es/index.js",
33
- "types": ". /dist/types/index.d.ts",
38
+ "main": ". /dist/lib/index.js",
39
+ "module": ". /dist/es/index.js",
40
+ "types": ". /dist/types/index.d.ts"
34
41
  }
35
42
  ```
43
+
36
44
  The build configuration corresponding to the preset string.
45
+
37
46
  ```js
38
47
  export const buildConfig = [
39
48
  {
40
49
  format: 'cjs',
41
50
  target: 'es6',
42
51
  buildType: 'bundle',
43
- outdir: '. /lib',
52
+ outDir: '. /lib',
44
53
  },
45
54
  {
46
55
  format: 'esm',
47
56
  target: 'es6',
48
57
  buildType: 'bundle',
49
- outdir: '. /es',
58
+ outDir: '. /es',
50
59
  },
51
60
  {
52
61
  buildType: 'bundle',
53
- outdir: '. /types',
62
+ outDir: '. /types',
54
63
  dts: {
55
64
  only: true,
56
65
  },
@@ -58,10 +67,11 @@ export const buildConfig = [
58
67
  ];
59
68
  ```
60
69
 
61
- ### ``npm-library-with-umd'``
62
- Used under class [NPM](https://www.npmjs.com/) package manager, and Library supports a similar pattern to [unpkg](https://unpkg.com/). Additional ``umd`` products are provided on top of the pre-defined ``npm-library'`.
70
+ ### `npm-library-with-umd'`
71
+
72
+ Used under class [NPM](https://www.npmjs.com/) package manager, and Library supports a similar pattern to [unpkg](https://unpkg.com/). Additional `umd` products are provided on top of the pre-defined `npm-library`.
63
73
 
64
- ```json title="package.json"
74
+ ```json package.json
65
75
  {
66
76
  "main": ". /dist/lib/index.js",
67
77
  "module": ". /dist/es/index.js",
@@ -69,30 +79,32 @@ Used under class [NPM](https://www.npmjs.com/) package manager, and Library supp
69
79
  "unpkg": ". /dist/umd/index.js",
70
80
  };
71
81
  ```
82
+
72
83
  The build configuration corresponding to the preset string.
84
+
73
85
  ```js
74
86
  export const buildConfig = [
75
87
  {
76
88
  format: 'cjs',
77
89
  target: 'es6',
78
90
  buildType: 'bundle',
79
- outdir: '. /lib',
91
+ outDir: '. /lib',
80
92
  },
81
93
  {
82
94
  format: 'esm',
83
95
  target: 'es6',
84
96
  buildType: 'bundle',
85
- outdir: '. /es',
97
+ outDir: '. /es',
86
98
  },
87
99
  {
88
100
  format: 'umd',
89
101
  target: 'es6',
90
102
  buildType: 'bundle',
91
- outdir: '. /umd',
103
+ outDir: '. /umd',
92
104
  },
93
105
  {
94
106
  buildType: 'bundle',
95
- outdir: '. /types',
107
+ outDir: '. /types',
96
108
  dts: {
97
109
  only: true,
98
110
  },
@@ -101,36 +113,38 @@ export const buildConfig = [
101
113
  ```
102
114
 
103
115
  ### `'npm-component'`
104
- A generic pattern for components (libraries) used under the class [NPM](https://www.npmjs.com/) package manager. Contains both `esm` and `cjs` Bundleless products (for easy *[Tree shaking](https://developer.mozilla.org/zh-CN/docs/Glossary/Tree_shaking)* optimization), as well as including a copy of the type file.
116
+
117
+ A generic pattern for components (libraries) used under the class [NPM](https://www.npmjs.com/) package manager. Contains both `esm` and `cjs` Bundleless products (for easy _[Tree shaking](https://developer.mozilla.org/zh-CN/docs/Glossary/Tree_shaking)_ optimization), as well as including a copy of the type file.
105
118
 
106
119
  For style files included in the source code, the products provide the compiled product of the style and the source file of the style.
107
120
 
108
- ```json title="package.json"
121
+ ```json package.json
109
122
  {
110
123
  "main": ". /dist/lib/index.js", // bundleless type
111
124
  "module": ". /dist/es/index.js", // bundleless type
112
125
  "types": ". /dist/types/index.d.ts",
113
126
  };
114
127
  ```
128
+
115
129
  The pre-defined strings correspond to the build configuration.
116
130
 
117
- ``` js
131
+ ```js
118
132
  export const buildConfig = [
119
133
  {
120
134
  format: 'cjs',
121
135
  target: 'es6',
122
136
  buildType: 'bundleless',
123
- outdir: '. /lib',
137
+ outDir: '. /lib',
124
138
  },
125
139
  {
126
140
  format: 'esm',
127
141
  target: 'es6',
128
142
  buildType: 'bundleless',
129
- outdir: '. /es',
143
+ outDir: '. /es',
130
144
  },
131
145
  {
132
146
  buildType: 'bundleless',
133
- outdir: '. /types',
147
+ outDir: '. /types',
134
148
  dts: {
135
149
  only: true,
136
150
  },
@@ -140,8 +154,9 @@ export const buildConfig = [
140
154
 
141
155
  ### `'npm-component-with-umd'`
142
156
 
143
- Component (library) used under class [NPM](https://www.npmjs.com/) package manager, with support for class [unpkg](https://unpkg.com/) schema. Additional ``umd`` products are provided on top of the pre-defined ``npm-component'`.
144
- ```json title="package.json"
157
+ Component (library) used under class [NPM](https://www.npmjs.com/) package manager, with support for class [unpkg](https://unpkg.com/) schema. Additional `umd` products are provided on top of the pre-defined `npm-component`.
158
+
159
+ ```json package.json
145
160
  {
146
161
  "main": ". /dist/lib/index.js", // bundleless type
147
162
  "module": ". /dist/es/index.js", // bundleless type
@@ -149,29 +164,30 @@ Component (library) used under class [NPM](https://www.npmjs.com/) package manag
149
164
  "unpkg": ". /dist/umd/index.js",
150
165
  };
151
166
  ```
167
+
152
168
  ```js
153
169
  export const buildConfig = [
154
170
  {
155
171
  format: 'cjs',
156
172
  target: 'es6',
157
173
  buildType: 'bundleless',
158
- outdir: '. /lib',
174
+ outDir: '. /lib',
159
175
  },
160
176
  {
161
177
  format: 'esm',
162
178
  target: 'es6',
163
179
  buildType: 'bundleless',
164
- outdir: '. /es',
180
+ outDir: '. /es',
165
181
  },
166
- {
182
+ {
167
183
  format: 'umd',
168
184
  target: 'es6',
169
185
  buildType: 'bundle',
170
- outdir: '. /umd',
186
+ outDir: '. /umd',
171
187
  },
172
188
  {
173
189
  buildType: 'bundleless',
174
- outdir: '. /types',
190
+ outDir: '. /types',
175
191
  dts: {
176
192
  only: true,
177
193
  },
@@ -179,26 +195,29 @@ export const buildConfig = [
179
195
  ];
180
196
  ```
181
197
 
182
- ### About the ECMAScript versions supported by the preset and `{es5.... .esnext}`
183
-
198
+ ### About the ECMAScript versions supported by the presets and `{es5.... .esnext}`
184
199
 
185
200
  When you want to use a `buildPreset` preset that supports other ECMAScript versions, you can directly add the supported versions to the `'npm-library'`, `'npm-library-with-umd'`, `'npm-component'`, `'npm-component-with-umd'` presets.
186
201
 
187
- For example, if you want the ``npm-library'` preset to support ``es2017``, you can configure it as follows.
202
+ For example, if you want the `` npm-library'` preset to support ``es2017``, you can configure it as follows.
188
203
 
189
- ```js
190
- export default {
204
+ ```js modern.config.ts
205
+ import { defineConfig } from '@modern-js/module-tools';
206
+
207
+ export default defineConfig({
191
208
  buildPreset: 'npm-library-es2017',
192
- };
209
+ });
193
210
  ```
194
211
 
195
212
  ## Function
196
213
 
197
- The way the function is configured, you can get the preset value with the `preset` parameter and then modify the build configuration inside to customize your build configuration.
214
+ The way the function is configured, you can get the preset value from the `preset` parameter and then modify the build configuration inside to customize your build configuration.
198
215
  The following is an example of how a function can be configured to compress a build product.
199
216
 
200
- ```js
201
- export default {
217
+ ```js modern.config.ts
218
+ import { defineConfig } from '@modern-js/module-tools';
219
+
220
+ export default defineConfig({
202
221
  buildPreset({ preset }) {
203
222
  const { NPM_LIBRARY } = preset;
204
223
  return NPM_LIBRARY.map(config => {
@@ -210,5 +229,5 @@ export default {
210
229
  return config;
211
230
  });
212
231
  },
213
- }
232
+ });
214
233
  ```