@@ -5,25 +5,89 @@ import { IOpts as AutoPolyfillsWebpackPluginOptions } from '@dtinsight/auto-poly
5
5
6
6
export type IOptions = {
7
7
//common configs
8
+ /**
9
+ * The current working directory.
10
+ * @param {string }
11
+ */
8
12
cwd : string ;
13
+ /**
14
+ * An object mapping module names to file paths or directories.
15
+ * @param {Record<string, string> }
16
+ */
9
17
alias ?: Record < string , string > ;
18
+ /**
19
+ * An array of patterns specifying files to copy to the output directory.
20
+ * @param {Pattern[] }
21
+ */
10
22
copy ?: Pattern [ ] ;
23
+ /**
24
+ * The entry point of the application.
25
+ * @param {string }
26
+ */
11
27
entry ?: string ;
28
+ /**
29
+ * The path to the output directory.
30
+ * @param {string }
31
+ */
12
32
outputPath ?: string ;
33
+ /**
34
+ * The public path of the application.
35
+ * @param {string }
36
+ */
13
37
publicPath ?: string ;
38
+ /**
39
+ * Whether to append a hash to the output file name for cache busting.
40
+ * @param {boolean }
41
+ */
14
42
hash ?: boolean ;
43
+ /**
44
+ * An object mapping module names to global variables.
45
+ * @param {Record<string, string> }
46
+ */
15
47
externals ?: Record < string , string > ;
48
+ /**
49
+ * An array of plugin configurations.
50
+ * @param {HookOptions[] }
51
+ */
16
52
plugins ?: HookOptions [ ] ;
53
+ /**
54
+ * The path to the HTML template to use for the application.
55
+ * @param {string }
56
+ */
17
57
htmlTemplate ?: string ;
18
58
htmlChunks ?: 'all' | string [ ] ;
19
59
// style configs
60
+ /**
61
+ * Whether to enable the bundle analyzer plugin.
62
+ * @param {boolean }
63
+ */
20
64
analyzer ?: boolean ;
65
+ /**
66
+ * An array of additional PostCSS plugins to use.
67
+ * @param {Plugin[] }
68
+ */
21
69
extraPostCSSPlugins ?: Plugin [ ] ;
70
+ /**
71
+ * Options to pass to the Less compiler.
72
+ * @param {* }
73
+ */
22
74
lessOptions ?: any ;
23
75
// integrated plugins options
76
+ /**
77
+ * A function to dynamically resolve module requests.
78
+ * @param {Function }
79
+ */
24
80
dynamicResolve ?: < T extends any > ( request : T ) => T ;
81
+ /**
82
+ * Whether to enable the auto-polyfills plugin, or an options object for the plugin.
83
+ * @param {string }
84
+ */
25
85
autoPolyfills : boolean | AutoPolyfillsWebpackPluginOptions ;
26
86
// dev, or serve configs
87
+ /**
88
+ * Options for the development server.
89
+ * @param {{proxy?: Record<string, any>, host: string, port: number, staticPath?: string, historyApiFallback?: any, compilationSuccessInfo?: { messages: string[]; notes?: string[] }} }
90
+ */
27
91
serve : {
28
92
proxy ?: Record < string , any > ;
29
93
host : string ;
@@ -33,6 +97,10 @@ export type IOptions = {
33
97
compilationSuccessInfo ?: { messages : string [ ] ; notes ?: string [ ] } ;
34
98
} ;
35
99
// experimental features
100
+ /**
101
+ * Experimental features to enable.
102
+ * @param {{speedUp?: boolean, minimizer?: boolean, disableLazyImports?: boolean, enableCssModule?: boolean, compress?: any} }
103
+ */
36
104
experiment ?: {
37
105
speedUp ?: boolean ;
38
106
minimizer ?: boolean ;
@@ -41,6 +109,10 @@ export type IOptions = {
41
109
compress ?: any ;
42
110
} ;
43
111
//misc
112
+ /**
113
+ * Options for the linter plugins.
114
+ * @param {Record<IKeys, Omit<IOpts, 'write'>> }
115
+ */
44
116
lints ?: Record < IKeys , Omit < IOpts , 'write' > > ;
45
117
} ;
46
118
0 commit comments