@@ -5,25 +5,89 @@ import { IOpts as AutoPolyfillsWebpackPluginOptions } from '@dtinsight/auto-poly
55
66export type IOptions = {
77 //common configs
8+ /**
9+ * The current working directory.
10+ * @param {string }
11+ */
812 cwd : string ;
13+ /**
14+ * An object mapping module names to file paths or directories.
15+ * @param {Record<string, string> }
16+ */
917 alias ?: Record < string , string > ;
18+ /**
19+ * An array of patterns specifying files to copy to the output directory.
20+ * @param {Pattern[] }
21+ */
1022 copy ?: Pattern [ ] ;
23+ /**
24+ * The entry point of the application.
25+ * @param {string }
26+ */
1127 entry ?: string ;
28+ /**
29+ * The path to the output directory.
30+ * @param {string }
31+ */
1232 outputPath ?: string ;
33+ /**
34+ * The public path of the application.
35+ * @param {string }
36+ */
1337 publicPath ?: string ;
38+ /**
39+ * Whether to append a hash to the output file name for cache busting.
40+ * @param {boolean }
41+ */
1442 hash ?: boolean ;
43+ /**
44+ * An object mapping module names to global variables.
45+ * @param {Record<string, string> }
46+ */
1547 externals ?: Record < string , string > ;
48+ /**
49+ * An array of plugin configurations.
50+ * @param {HookOptions[] }
51+ */
1652 plugins ?: HookOptions [ ] ;
53+ /**
54+ * The path to the HTML template to use for the application.
55+ * @param {string }
56+ */
1757 htmlTemplate ?: string ;
1858 htmlChunks ?: 'all' | string [ ] ;
1959 // style configs
60+ /**
61+ * Whether to enable the bundle analyzer plugin.
62+ * @param {boolean }
63+ */
2064 analyzer ?: boolean ;
65+ /**
66+ * An array of additional PostCSS plugins to use.
67+ * @param {Plugin[] }
68+ */
2169 extraPostCSSPlugins ?: Plugin [ ] ;
70+ /**
71+ * Options to pass to the Less compiler.
72+ * @param {* }
73+ */
2274 lessOptions ?: any ;
2375 // integrated plugins options
76+ /**
77+ * A function to dynamically resolve module requests.
78+ * @param {Function }
79+ */
2480 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+ */
2585 autoPolyfills : boolean | AutoPolyfillsWebpackPluginOptions ;
2686 // 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+ */
2791 serve : {
2892 proxy ?: Record < string , any > ;
2993 host : string ;
@@ -33,6 +97,10 @@ export type IOptions = {
3397 compilationSuccessInfo ?: { messages : string [ ] ; notes ?: string [ ] } ;
3498 } ;
3599 // experimental features
100+ /**
101+ * Experimental features to enable.
102+ * @param {{speedUp?: boolean, minimizer?: boolean, disableLazyImports?: boolean, enableCssModule?: boolean, compress?: any} }
103+ */
36104 experiment ?: {
37105 speedUp ?: boolean ;
38106 minimizer ?: boolean ;
@@ -41,6 +109,10 @@ export type IOptions = {
41109 compress ?: any ;
42110 } ;
43111 //misc
112+ /**
113+ * Options for the linter plugins.
114+ * @param {Record<IKeys, Omit<IOpts, 'write'>> }
115+ */
44116 lints ?: Record < IKeys , Omit < IOpts , 'write' > > ;
45117} ;
46118
0 commit comments