1 | interface BabelOpts {
|
2 | jsx?: string
|
3 | include?: string[]
|
4 | }
|
5 |
|
6 | interface CSSOpts {
|
7 | /**
|
8 | * Extract CSS into a single file
|
9 | */
|
10 | extract?: boolean
|
11 | /**
|
12 | * Enable CSS modules for all CSS files
|
13 | */
|
14 | modules?: boolean
|
15 | }
|
16 |
|
17 | interface FilenameOpts {
|
18 | js?: string
|
19 | css?: string
|
20 | chunk?: string
|
21 | image?: string
|
22 | font?: string
|
23 | }
|
24 |
|
25 | interface VueOpts {
|
26 | /**
|
27 | * Use runtime+compiler build for Vue.js
|
28 | */
|
29 | fullBuild?: boolean
|
30 |
|
31 | /**
|
32 | * Options for vue-loader
|
33 | */
|
34 | loaderOptions?: {
|
35 | [k: string]: any
|
36 | }
|
37 | }
|
38 |
|
39 | interface HTMLOpts {
|
40 | /**
|
41 | * Custom HTML title
|
42 | */
|
43 | title?: string
|
44 | /**
|
45 | * Custom meta description tag
|
46 | */
|
47 | description?: string
|
48 | [k: string]: any
|
49 | }
|
50 |
|
51 | interface PoiOptions {
|
52 | /**
|
53 | * The entry file of your app.
|
54 | */
|
55 | entry?: string | string[] | {[k: string]: string[]}
|
56 |
|
57 | /**
|
58 | * The output directory of bundled files.
|
59 | */
|
60 | outDir?: string
|
61 |
|
62 | /**
|
63 | * Clean output directory before bundling
|
64 | */
|
65 | cleanOutDir?: boolean
|
66 |
|
67 | /**
|
68 | * This option specifies the public URL of the output directory when referenced in a browser.
|
69 | */
|
70 | publicPath?:string
|
71 |
|
72 | /**
|
73 | * Bundle format
|
74 | */
|
75 | format?: string
|
76 |
|
77 | /**
|
78 | * Customize babel behavior
|
79 | */
|
80 | babel?: BabelOpts
|
81 |
|
82 | css?: CSSOpts
|
83 |
|
84 | /**
|
85 | * Specify the module name of bundled umd library
|
86 | */
|
87 | moduleName?: string
|
88 |
|
89 | /**
|
90 | * Whether to load local .env file
|
91 | */
|
92 | env?: boolean
|
93 |
|
94 | /**
|
95 | * Define global constants which can be configured at compile time.
|
96 | */
|
97 | define?: {
|
98 | [k: string]: any
|
99 | }
|
100 |
|
101 | /**
|
102 | * Options for html-webpack-plugin
|
103 | */
|
104 | html?: HTMLOpts | HTMLOpts[]
|
105 |
|
106 | /**
|
107 | * Toggle source map or use custom source map type
|
108 | */
|
109 | sourceMap?: string | boolean
|
110 |
|
111 | /**
|
112 | * Minimize bundled code.
|
113 | */
|
114 | minimize?: boolean
|
115 |
|
116 | /**
|
117 | * Customize output filenames
|
118 | */
|
119 | filename?: FilenameOpts
|
120 |
|
121 | /**
|
122 | * Customize vue
|
123 | */
|
124 | vue?: VueOpts
|
125 |
|
126 | /**
|
127 | * Options for webpack-dev-servr
|
128 | */
|
129 | devServer?: any
|
130 |
|
131 | /**
|
132 | * Port for dev server
|
133 | */
|
134 | port?: number
|
135 |
|
136 | /**
|
137 | * Host for dev server
|
138 | */
|
139 | host?: string
|
140 |
|
141 | /**
|
142 | * Toggle hot reloading
|
143 | */
|
144 | hotReload?: boolean
|
145 |
|
146 | /**
|
147 | * Make certain entries hotreload-able
|
148 | */
|
149 | hotEntry?: string | string[]
|
150 |
|
151 | /**
|
152 | * Restart the Poi process when specific files are modified.
|
153 | */
|
154 | restartOnFileChanges?: string | string[]
|
155 |
|
156 | /**
|
157 | * Toggle hash in output filenames
|
158 | */
|
159 | hash?: boolean
|
160 |
|
161 | /**
|
162 | * Use Poi plugins
|
163 | */
|
164 | plugins?: any // TODO: type this
|
165 |
|
166 | /**
|
167 | * Whatever else
|
168 | */
|
169 | [k: string]: any
|
170 | }
|
171 |
|
172 | type Options = PoiOptions | ((opts: PoiOptions) => PoiOptions)
|
173 |
|
174 | export {
|
175 | Options
|
176 | }
|
177 |
|
\ | No newline at end of file |