@@ -12,6 +12,9 @@ interface SyntaxFeatures {
12
12
}
13
13
14
14
interface Optimization {
15
+ /**
16
+ * Optimize code by remove react-router dependencies when set to true.
17
+ */
15
18
router ?: boolean ;
16
19
}
17
20
@@ -33,60 +36,224 @@ interface Fetcher {
33
36
}
34
37
35
38
export interface UserConfig {
39
+ /**
40
+ * Feature polyfill for legacy browsers, which can not polyfilled by core-js.
41
+ * @see https://v3.ice.work/docs/guide/basic/config#featurepolyfill
42
+ */
36
43
featurePolyfill ?: {
37
44
abortcontroller ?: boolean | string ;
38
45
} ;
39
46
output ?: {
40
47
distType : Array < DistType > | DistType ;
41
48
prependCode ?: string ;
42
49
} ;
50
+ /**
51
+ * Alias for import certain modules more easily.
52
+ * @see https://v3.ice.work/docs/guide/basic/config#alias
53
+ */
43
54
alias ?: Record < string , string | false > ;
55
+ /**
56
+ * Define global constants which can be configured at compile time.
57
+ * @see https://v3.ice.work/docs/guide/basic/config#define
58
+ */
44
59
define ?: Record < string , string | boolean > ;
60
+ /**
61
+ * Configure the publicPath, it only works in dev mode.
62
+ * @see https://v3.ice.work/docs/guide/basic/config#devpublicpath
63
+ */
45
64
devPublicPath ?: string ;
65
+ /**
66
+ * Configure the publicPath, it only works in prod mode.
67
+ * @see https://v3.ice.work/docs/guide/basic/config#publicpath
68
+ */
46
69
publicPath ?: string ;
70
+ /**
71
+ * Configure hash based file name.
72
+ * @see https://v3.ice.work/docs/guide/basic/config#hash
73
+ */
47
74
hash ?: boolean | string ;
75
+ /**
76
+ * Configure externals to prevent bundling certain imported packages and
77
+ * instead retrieve these external dependencies at runtime.
78
+ * @see https://v3.ice.work/docs/guide/basic/config#externals
79
+ */
48
80
externals ?: Config [ 'externals' ] ;
81
+ /**
82
+ * The output directory for build command.
83
+ * @see https://v3.ice.work/docs/guide/basic/config#outputdir
84
+ */
49
85
outputDir ?: string ;
86
+ /**
87
+ * Proxy configuration for dev server, as same as webpack devServer.proxy.
88
+ * @see https://v3.ice.work/docs/guide/basic/config#proxy
89
+ */
50
90
proxy ?: Config [ 'proxy' ] ;
91
+ /**
92
+ * Polyfill mode for legacy browsers, works with .browserslistrc, support entry and usage.
93
+ * @see https://v3.ice.work/docs/guide/basic/config#polyfill
94
+ */
51
95
polyfill ?: Config [ 'polyfill' ] ;
96
+ /**
97
+ * Configure the output file name of build bundle.
98
+ */
52
99
filename ?: string ;
100
+ /**
101
+ * Modify the webpack configuration, it is not recommended.
102
+ * @see https://v3.ice.work/docs/guide/basic/config#webpack
103
+ */
53
104
webpack ?: ModifyWebpackConfig ;
54
- postcss ?: ProcessOptions & { plugins ?: ( string | [ string , Record < string , any > ?] ) [ ] } ;
105
+ /**
106
+ * Allows to set PostCSS options and plugins.
107
+ * @see https://v3.ice.work/docs/guide/basic/config#postcss
108
+ */
109
+ postcss ?: ProcessOptions & {
110
+ plugins ?: ( string | [ string , Record < string , any > ?] ) [ ] ;
111
+ } ;
112
+ /**
113
+ * Custom file-system based route rules.
114
+ * @see https://v3.ice.work/docs/guide/basic/config#routes
115
+ */
55
116
routes ?: {
117
+ /**
118
+ * Ignore files when generate routes when match rule.
119
+ */
56
120
ignoreFiles ?: string [ ] ;
121
+ /**
122
+ * Define route rules by API.
123
+ */
57
124
defineRoutes ?: ( defineRoute : DefineRouteFunction ) => void ;
125
+ /**
126
+ * Define route rules by route config.
127
+ */
58
128
config ?: RouteItem [ ] ;
129
+ /**
130
+ * inject initial route path for each route html.
131
+ */
59
132
injectInitialEntry ?: boolean ;
60
133
} ;
134
+ /**
135
+ * Add ice.js plugin to customize framework config.
136
+ * @see https://v3.ice.work/docs/guide/basic/config#plugins
137
+ */
61
138
plugins ?: PluginList < Config , OverwritePluginAPI > ;
139
+ /**
140
+ * `console.*` will be dropped when build.
141
+ * @see https://v3.ice.work/docs/guide/basic/config#droploglevel
142
+ */
62
143
dropLogLevel ?: 'trace' | 'debug' | 'log' | 'info' | 'warn' | 'error' ;
144
+ /**
145
+ * Minify build output, it only works in prod mode by default.
146
+ * @see https://v3.ice.work/docs/guide/basic/config#minify
147
+ */
63
148
minify ?: boolean | 'swc' | MinifyOptions ;
149
+ /**
150
+ * Compile dependencies, ice.js will compile all dependencies by default when build for compatibility.
151
+ * @see https://v3.ice.work/docs/guide/basic/config#compiledependencies
152
+ */
64
153
compileDependencies ?: boolean | string [ ] | RegExp [ ] ;
154
+ /**
155
+ * HTML will not be generated when build, If it is false.
156
+ * @see https://v3.ice.work/docs/guide/basic/config#htmlgenerating
157
+ */
158
+ htmlGenerating ?: boolean ;
159
+ /**
160
+ * Choose a style of souce mapping to enhance the debugging process.
161
+ * @see https://v3.ice.work/docs/guide/basic/config#sourcemap
162
+ */
65
163
sourceMap ?: string | boolean ;
164
+ /**
165
+ * Check typescript when compile source code.
166
+ * @see https://v3.ice.work/docs/guide/basic/config#tschecker
167
+ */
66
168
tsChecker ?: boolean ;
169
+ /**
170
+ * Check source code by eslint if eslint options is configured.
171
+ * @see https://v3.ice.work/docs/guide/basic/config#eslint
172
+ */
67
173
eslint ?: Config [ 'eslintOptions' ] | boolean ;
174
+ /**
175
+ * A switch for SSR (Server Side Rendering)
176
+ * @see https://v3.ice.work/docs/guide/basic/config#ssr
177
+ */
68
178
ssr ?: boolean ;
179
+ /**
180
+ * A switch for SSG (Static Site Generation), it is true by default.
181
+ * @see https://v3.ice.work/docs/guide/basic/config#ssg
182
+ */
69
183
ssg ?: boolean ;
184
+ /**
185
+ * config for server bundle
186
+ * @see https://v3.ice.work/docs/guide/basic/config#server
187
+ */
70
188
server ?: {
189
+ /**
190
+ * onDemand compilation for server when dev
191
+ */
71
192
onDemand ?: boolean ;
193
+ /**
194
+ * bundle format for server bundle, support esm and cjs
195
+ */
72
196
format ?: 'esm' | 'cjs' ;
197
+ /**
198
+ * bundle server code as a single file
199
+ */
73
200
bundle ?: boolean ;
201
+ /**
202
+ * ignore file when bundle server code, module return empty when match
203
+ */
74
204
ignores ?: IgnorePattern [ ] ;
205
+ /**
206
+ * externals config for server bundle
207
+ */
75
208
externals ?: string [ ] ;
76
209
} ;
210
+ /**
211
+ * Optimization options for build.
212
+ * @sse https://v3.ice.work/docs/guide/basic/config#optimization
213
+ */
77
214
optimization ?: Optimization ;
78
- mock ?: { exclude ?: string [ ] } ;
215
+ /**
216
+ * Configure mock rules for development.
217
+ * @see https://v3.ice.work/docs/guide/basic/config#mock
218
+ */
219
+ mock ?: {
220
+ exclude ?: string [ ] ;
221
+ } ;
222
+ /**
223
+ * Config for experimental features.
224
+ * @see https://v3.ice.work/docs/guide/basic/config#experimental
225
+ */
79
226
experimental ?: Config [ 'experimental' ] ;
227
+ /**
228
+ * Custom transform rules for source code.
229
+ * @see https://v3.ice.work/docs/guide/basic/config#transform
230
+ */
80
231
transform ?: UnpluginOptions [ 'transform' ] ;
232
+ /**
233
+ * Specify the syntax features you want to use.
234
+ * @see https://v3.ice.work/docs/guide/basic/config#syntaxfeatures
235
+ */
81
236
syntaxFeatures ?: SyntaxFeatures ;
82
237
/**
83
238
* @deprecated
84
239
* Please use `codeSplitting` instead
85
240
*/
86
241
splitChunks ?: boolean ;
242
+ /**
243
+ * Code splitting strategy, support page and vendors, default value is true (built-in strategy).
244
+ * @see https://v3.ice.work/docs/guide/basic/config#codesplitting
245
+ */
87
246
codeSplitting ?: 'page' | 'vendors' | boolean ;
247
+ /**
248
+ * generate additional assets for request data, default is true
249
+ * @see https://v3.ice.work/docs/guide/basic/config#dataloader
250
+ */
88
251
dataLoader ?: {
89
252
fetcher ?: Fetcher ;
90
253
} | Boolean ;
254
+ /**
255
+ * Enable cross-origin loading of chunks.
256
+ * @see https://v3.ice.work/docs/guide/basic/config#crossoriginloading
257
+ */
91
258
crossOriginLoading ?: Config [ 'output' ] [ 'crossOriginLoading' ] ;
92
259
}
0 commit comments