@ohos-ports/rsbuild-core 1.1.14-beta.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 (244) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/bin/rsbuild.js +20 -0
  4. package/compiled/chokidar/index.d.ts +345 -0
  5. package/compiled/chokidar/index.js +1778 -0
  6. package/compiled/chokidar/license +21 -0
  7. package/compiled/chokidar/package.json +1 -0
  8. package/compiled/connect/index.d.ts +90 -0
  9. package/compiled/connect/index.js +1240 -0
  10. package/compiled/connect/license +25 -0
  11. package/compiled/connect/package.json +1 -0
  12. package/compiled/connect-history-api-fallback/index.d.ts +1 -0
  13. package/compiled/connect-history-api-fallback/index.js +149 -0
  14. package/compiled/connect-history-api-fallback/license +21 -0
  15. package/compiled/connect-history-api-fallback/package.json +1 -0
  16. package/compiled/cors/index.d.ts +1 -0
  17. package/compiled/cors/index.js +371 -0
  18. package/compiled/cors/license +22 -0
  19. package/compiled/cors/package.json +1 -0
  20. package/compiled/css-loader/api.js +85 -0
  21. package/compiled/css-loader/getUrl.js +26 -0
  22. package/compiled/css-loader/index.d.ts +1 -0
  23. package/compiled/css-loader/index.js +8008 -0
  24. package/compiled/css-loader/license +20 -0
  25. package/compiled/css-loader/noSourceMaps.js +5 -0
  26. package/compiled/css-loader/package.json +1 -0
  27. package/compiled/css-loader/sourceMaps.js +16 -0
  28. package/compiled/html-rspack-plugin/default_index.ejs +9 -0
  29. package/compiled/html-rspack-plugin/index.d.ts +289 -0
  30. package/compiled/html-rspack-plugin/index.js +1583 -0
  31. package/compiled/html-rspack-plugin/license +20 -0
  32. package/compiled/html-rspack-plugin/loader.js +162 -0
  33. package/compiled/html-rspack-plugin/package.json +1 -0
  34. package/compiled/http-proxy-middleware/index.d.ts +318 -0
  35. package/compiled/http-proxy-middleware/index.js +5280 -0
  36. package/compiled/http-proxy-middleware/license +22 -0
  37. package/compiled/http-proxy-middleware/package.json +1 -0
  38. package/compiled/jiti/index.d.ts +1 -0
  39. package/compiled/jiti/index.js +416 -0
  40. package/compiled/jiti/license +21 -0
  41. package/compiled/jiti/package.json +1 -0
  42. package/compiled/launch-editor-middleware/index.d.ts +1 -0
  43. package/compiled/launch-editor-middleware/index.js +694 -0
  44. package/compiled/launch-editor-middleware/license +21 -0
  45. package/compiled/launch-editor-middleware/package.json +1 -0
  46. package/compiled/mrmime/index.d.ts +4 -0
  47. package/compiled/mrmime/index.js +452 -0
  48. package/compiled/mrmime/package.json +1 -0
  49. package/compiled/on-finished/index.d.ts +13 -0
  50. package/compiled/on-finished/index.js +197 -0
  51. package/compiled/on-finished/license +23 -0
  52. package/compiled/on-finished/package.json +1 -0
  53. package/compiled/open/index.d.ts +153 -0
  54. package/compiled/open/index.js +409 -0
  55. package/compiled/open/package.json +1 -0
  56. package/compiled/open/xdg-open +1066 -0
  57. package/compiled/picocolors/index.d.ts +55 -0
  58. package/compiled/picocolors/index.js +108 -0
  59. package/compiled/picocolors/license +15 -0
  60. package/compiled/picocolors/package.json +1 -0
  61. package/compiled/postcss/index.d.ts +1 -0
  62. package/compiled/postcss/index.js +5997 -0
  63. package/compiled/postcss/license +20 -0
  64. package/compiled/postcss/package.json +1 -0
  65. package/compiled/postcss-load-config/index.d.ts +1 -0
  66. package/compiled/postcss-load-config/index.js +739 -0
  67. package/compiled/postcss-load-config/license +20 -0
  68. package/compiled/postcss-load-config/package.json +1 -0
  69. package/compiled/postcss-loader/index.d.ts +1 -0
  70. package/compiled/postcss-loader/index.js +741 -0
  71. package/compiled/postcss-loader/license +20 -0
  72. package/compiled/postcss-loader/package.json +1 -0
  73. package/compiled/rsbuild-dev-middleware/index.d.ts +1 -0
  74. package/compiled/rsbuild-dev-middleware/index.js +6158 -0
  75. package/compiled/rsbuild-dev-middleware/license +20 -0
  76. package/compiled/rsbuild-dev-middleware/package.json +1 -0
  77. package/compiled/rslog/index.d.ts +66 -0
  78. package/compiled/rslog/index.js +334 -0
  79. package/compiled/rslog/license +21 -0
  80. package/compiled/rslog/package.json +1 -0
  81. package/compiled/rspack-chain/index.d.ts +611 -0
  82. package/compiled/rspack-chain/index.js +1740 -0
  83. package/compiled/rspack-chain/license +373 -0
  84. package/compiled/rspack-chain/package.json +1 -0
  85. package/compiled/rspack-manifest-plugin/index.d.ts +44 -0
  86. package/compiled/rspack-manifest-plugin/index.js +394 -0
  87. package/compiled/rspack-manifest-plugin/license +21 -0
  88. package/compiled/rspack-manifest-plugin/package.json +1 -0
  89. package/compiled/sirv/index.d.ts +1 -0
  90. package/compiled/sirv/index.js +709 -0
  91. package/compiled/sirv/package.json +1 -0
  92. package/compiled/style-loader/index.d.ts +1 -0
  93. package/compiled/style-loader/index.js +427 -0
  94. package/compiled/style-loader/license +20 -0
  95. package/compiled/style-loader/package.json +1 -0
  96. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  97. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  98. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  99. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  100. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  101. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  102. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  103. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  104. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  105. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  106. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  107. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  108. package/compiled/tinyglobby/index.d.ts +25 -0
  109. package/compiled/tinyglobby/index.js +2749 -0
  110. package/compiled/tinyglobby/index1.js +17 -0
  111. package/compiled/tinyglobby/license +21 -0
  112. package/compiled/tinyglobby/package.json +1 -0
  113. package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
  114. package/compiled/webpack-bundle-analyzer/index.js +13480 -0
  115. package/compiled/webpack-bundle-analyzer/license +20 -0
  116. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  117. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  118. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  119. package/compiled/webpack-merge/index.d.ts +31 -0
  120. package/compiled/webpack-merge/index.js +1200 -0
  121. package/compiled/webpack-merge/license +20 -0
  122. package/compiled/webpack-merge/package.json +1 -0
  123. package/compiled/ws/index.d.ts +401 -0
  124. package/compiled/ws/index.js +3153 -0
  125. package/compiled/ws/license +20 -0
  126. package/compiled/ws/package.json +1 -0
  127. package/dist/client/hmr.js +143 -0
  128. package/dist/client/overlay.js +210 -0
  129. package/dist/ignoreCssLoader.mjs +4 -0
  130. package/dist/index.cjs +7251 -0
  131. package/dist/index.js +7118 -0
  132. package/dist/transformLoader.mjs +22 -0
  133. package/dist/transformRawLoader.mjs +22 -0
  134. package/dist-types/cli/commands.d.ts +23 -0
  135. package/dist-types/cli/index.d.ts +1 -0
  136. package/dist-types/cli/init.d.ts +7 -0
  137. package/dist-types/cli/prepare.d.ts +1 -0
  138. package/dist-types/client/hmr.d.ts +1 -0
  139. package/dist-types/client/overlay.d.ts +1 -0
  140. package/dist-types/config.d.ts +90 -0
  141. package/dist-types/configChain.d.ts +139 -0
  142. package/dist-types/constants.d.ts +37 -0
  143. package/dist-types/createContext.d.ts +11 -0
  144. package/dist-types/createRsbuild.d.ts +2 -0
  145. package/dist-types/helpers/format.d.ts +5 -0
  146. package/dist-types/helpers/fs.d.ts +13 -0
  147. package/dist-types/helpers/index.d.ts +47 -0
  148. package/dist-types/helpers/path.d.ts +11 -0
  149. package/dist-types/helpers/stats.d.ts +9 -0
  150. package/dist-types/hooks.d.ts +48 -0
  151. package/dist-types/index.d.ts +26 -0
  152. package/dist-types/initPlugins.d.ts +6 -0
  153. package/dist-types/internal.d.ts +6 -0
  154. package/dist-types/loadEnv.d.ts +50 -0
  155. package/dist-types/loader/ignoreCssLoader.d.ts +2 -0
  156. package/dist-types/loader/transformLoader.d.ts +7 -0
  157. package/dist-types/loader/transformRawLoader.d.ts +3 -0
  158. package/dist-types/logger.d.ts +4 -0
  159. package/dist-types/mergeConfig.d.ts +2 -0
  160. package/dist-types/package.json +1 -0
  161. package/dist-types/pluginHelper.d.ts +12 -0
  162. package/dist-types/pluginManager.d.ts +9 -0
  163. package/dist-types/plugins/appIcon.d.ts +2 -0
  164. package/dist-types/plugins/asset.d.ts +3 -0
  165. package/dist-types/plugins/basic.d.ts +5 -0
  166. package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
  167. package/dist-types/plugins/cache.d.ts +2 -0
  168. package/dist-types/plugins/cleanOutput.d.ts +3 -0
  169. package/dist-types/plugins/css.d.ts +3 -0
  170. package/dist-types/plugins/define.d.ts +2 -0
  171. package/dist-types/plugins/entry.d.ts +2 -0
  172. package/dist-types/plugins/externals.d.ts +2 -0
  173. package/dist-types/plugins/fileSize.d.ts +4 -0
  174. package/dist-types/plugins/html.d.ts +9 -0
  175. package/dist-types/plugins/inlineChunk.d.ts +2 -0
  176. package/dist-types/plugins/lazyCompilation.d.ts +2 -0
  177. package/dist-types/plugins/manifest.d.ts +2 -0
  178. package/dist-types/plugins/minimize.d.ts +10 -0
  179. package/dist-types/plugins/moduleFederation.d.ts +2 -0
  180. package/dist-types/plugins/moment.d.ts +2 -0
  181. package/dist-types/plugins/nodeAddons.d.ts +2 -0
  182. package/dist-types/plugins/nonce.d.ts +2 -0
  183. package/dist-types/plugins/output.d.ts +2 -0
  184. package/dist-types/plugins/performance.d.ts +5 -0
  185. package/dist-types/plugins/progress.d.ts +2 -0
  186. package/dist-types/plugins/resolve.d.ts +2 -0
  187. package/dist-types/plugins/resourceHints.d.ts +2 -0
  188. package/dist-types/plugins/rsdoctor.d.ts +2 -0
  189. package/dist-types/plugins/rspackProfile.d.ts +2 -0
  190. package/dist-types/plugins/server.d.ts +2 -0
  191. package/dist-types/plugins/splitChunks.d.ts +4 -0
  192. package/dist-types/plugins/sri.d.ts +2 -0
  193. package/dist-types/plugins/swc.d.ts +7 -0
  194. package/dist-types/plugins/target.d.ts +2 -0
  195. package/dist-types/plugins/wasm.d.ts +2 -0
  196. package/dist-types/provider/build.d.ts +3 -0
  197. package/dist-types/provider/createCompiler.d.ts +27 -0
  198. package/dist-types/provider/helpers.d.ts +12 -0
  199. package/dist-types/provider/initConfigs.d.ts +10 -0
  200. package/dist-types/provider/inspectConfig.d.ts +6 -0
  201. package/dist-types/provider/provider.d.ts +2 -0
  202. package/dist-types/provider/rspackConfig.d.ts +8 -0
  203. package/dist-types/rspack/RsbuildHtmlPlugin.d.ts +37 -0
  204. package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +29 -0
  205. package/dist-types/rspack/preload/helpers/determineAsValue.d.ts +22 -0
  206. package/dist-types/rspack/preload/helpers/doesChunkBelongToHtml.d.ts +29 -0
  207. package/dist-types/rspack/preload/helpers/extractChunks.d.ts +28 -0
  208. package/dist-types/rspack/preload/helpers/index.d.ts +4 -0
  209. package/dist-types/rspack/preload/helpers/type.d.ts +13 -0
  210. package/dist-types/server/ansiHTML.d.ts +12 -0
  211. package/dist-types/server/cliShortcuts.d.ts +10 -0
  212. package/dist-types/server/compilerDevMiddleware.d.ts +31 -0
  213. package/dist-types/server/devMiddleware.d.ts +27 -0
  214. package/dist-types/server/devServer.d.ts +60 -0
  215. package/dist-types/server/environment.d.ts +8 -0
  216. package/dist-types/server/getDevMiddlewares.d.ts +25 -0
  217. package/dist-types/server/gzipMiddleware.d.ts +4 -0
  218. package/dist-types/server/helper.d.ts +71 -0
  219. package/dist-types/server/httpServer.d.ts +8 -0
  220. package/dist-types/server/middlewares.d.ts +34 -0
  221. package/dist-types/server/open.d.ts +10 -0
  222. package/dist-types/server/prodServer.d.ts +25 -0
  223. package/dist-types/server/proxy.d.ts +6 -0
  224. package/dist-types/server/restart.d.ts +14 -0
  225. package/dist-types/server/runner/asModule.d.ts +2 -0
  226. package/dist-types/server/runner/basic.d.ts +25 -0
  227. package/dist-types/server/runner/cjs.d.ts +10 -0
  228. package/dist-types/server/runner/esm.d.ts +6 -0
  229. package/dist-types/server/runner/index.d.ts +8 -0
  230. package/dist-types/server/runner/type.d.ts +36 -0
  231. package/dist-types/server/socketServer.d.ts +26 -0
  232. package/dist-types/server/watchFiles.d.ts +14 -0
  233. package/dist-types/types/config.d.ts +1309 -0
  234. package/dist-types/types/context.d.ts +52 -0
  235. package/dist-types/types/hooks.d.ts +146 -0
  236. package/dist-types/types/index.d.ts +8 -0
  237. package/dist-types/types/plugin.d.ts +329 -0
  238. package/dist-types/types/rsbuild.d.ts +156 -0
  239. package/dist-types/types/rspack.d.ts +16 -0
  240. package/dist-types/types/thirdParty.d.ts +176 -0
  241. package/dist-types/types/utils.d.ts +12 -0
  242. package/package.json +61 -0
  243. package/static/openChrome.applescript +95 -0
  244. package/types.d.ts +221 -0
@@ -0,0 +1,20 @@
1
+ Copyright JS Foundation and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ module.exports = function (i) {
4
+ return i[1];
5
+ };
@@ -0,0 +1 @@
1
+ {"name":"css-loader","author":"Tobias Koppers @sokra","version":"7.1.2","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ module.exports = function (item) {
4
+ var content = item[1];
5
+ var cssMapping = item[3];
6
+ if (!cssMapping) {
7
+ return content;
8
+ }
9
+ if (typeof btoa === "function") {
10
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
11
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
12
+ var sourceMapping = "/*# ".concat(data, " */");
13
+ return [content].concat([sourceMapping]).join("\n");
14
+ }
15
+ return [content].join("\n");
16
+ };
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title><%= htmlWebpackPlugin.options.title %></title>
6
+ </head>
7
+ <body>
8
+ </body>
9
+ </html>
@@ -0,0 +1,289 @@
1
+ import { AsyncSeriesWaterfallHook } from '@rspack/lite-tapable';
2
+ import { Compiler, Compilation } from '@rspack/core';
3
+
4
+ declare class HtmlRspackPlugin {
5
+ constructor(options?: HtmlRspackPlugin.Options);
6
+
7
+ userOptions: HtmlRspackPlugin.Options;
8
+
9
+ /** Current HtmlRspackPlugin Major */
10
+ version: number;
11
+
12
+ /**
13
+ * Options after html-webpack-plugin has been initialized with defaults
14
+ */
15
+ options?: HtmlRspackPlugin.ProcessedOptions;
16
+
17
+ apply(compiler: Compiler): void;
18
+
19
+ /**
20
+ * @deprecated use `getCompilationHooks` instead
21
+ */
22
+ static getHooks(compilation: Compilation): HtmlRspackPlugin.Hooks;
23
+
24
+ static getCompilationHooks(compilation: Compilation): HtmlRspackPlugin.Hooks;
25
+
26
+ /**
27
+ * Static helper to create a tag object to be get injected into the dom
28
+ */
29
+ static createHtmlTagObject(
30
+ tagName: string,
31
+ attributes?: { [attributeName: string]: string | boolean },
32
+ innerHTML?: string,
33
+ ): HtmlRspackPlugin.HtmlTagObject;
34
+
35
+ static readonly version: number;
36
+ }
37
+
38
+ declare namespace HtmlRspackPlugin {
39
+ type MinifyOptions = HtmlMinifierOptions;
40
+
41
+ interface Options {
42
+ /**
43
+ * Emit the file only if it was changed.
44
+ * @default true
45
+ */
46
+ cache?: boolean;
47
+ /**
48
+ * List all entries which should be injected
49
+ */
50
+ chunks?: 'all' | string[];
51
+ /**
52
+ * Allows to control how chunks should be sorted before they are included to the html.
53
+ * @default 'auto'
54
+ */
55
+ chunksSortMode?:
56
+ | 'auto'
57
+ // `none` is deprecated and an alias for `auto` now.
58
+ | 'none'
59
+ | 'manual'
60
+ | ((entryNameA: string, entryNameB: string) => number);
61
+ /**
62
+ * List all entries which should not be injected
63
+ */
64
+ excludeChunks?: string[];
65
+ /**
66
+ * Path to the favicon icon
67
+ */
68
+ favicon?: false | string;
69
+ /**
70
+ * The file to write the HTML to.
71
+ * Supports subdirectories eg: `assets/admin.html`
72
+ * [name] will be replaced by the entry name
73
+ * Supports a function to generate the name
74
+ *
75
+ * @default 'index.html'
76
+ */
77
+ filename?: string | ((entryName: string) => string);
78
+ /**
79
+ * By default the public path is set to `auto` - that way the html-webpack-plugin will try
80
+ * to set the publicPath according to the current filename and the webpack publicPath setting
81
+ */
82
+ publicPath?: string | 'auto';
83
+ /**
84
+ * If `true` then append a unique `webpack` compilation hash to all included scripts and CSS files.
85
+ * This is useful for cache busting
86
+ */
87
+ hash?: boolean;
88
+ /**
89
+ * Inject all assets into the given `template` or `templateContent`.
90
+ */
91
+ inject?:
92
+ | false // Don't inject scripts
93
+ | true // Inject scripts into body
94
+ | 'body' // Inject scripts into body
95
+ | 'head'; // Inject scripts into head
96
+ /**
97
+ * Set up script loading
98
+ * blocking will result in <script src="..."></script>
99
+ * defer will result in <script defer src="..."></script>
100
+ *
101
+ * @default 'defer'
102
+ */
103
+ scriptLoading?: 'blocking' | 'defer' | 'module' | 'systemjs-module';
104
+ /**
105
+ * Inject meta tags
106
+ */
107
+ meta?:
108
+ | false // Disable injection
109
+ | {
110
+ [name: string]:
111
+ | string
112
+ | false // name content pair e.g. {viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no'}`
113
+ | { [attributeName: string]: string | boolean }; // custom properties e.g. { name:"viewport" content:"width=500, initial-scale=1" }
114
+ };
115
+ /**
116
+ * A function to minify the HTML
117
+ */
118
+ minify?: (html: string) => string | Promise<string>;
119
+ /**
120
+ * Render errors into the HTML page
121
+ */
122
+ showErrors?: boolean;
123
+ /**
124
+ * The `webpack` require path to the template.
125
+ * @see https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md
126
+ */
127
+ template?: string;
128
+ /**
129
+ * Allow to use a html string instead of reading from a file
130
+ */
131
+ templateContent?:
132
+ | false // Use the template option instead to load a file
133
+ | string
134
+ | ((templateParameters: {
135
+ [option: string]: any;
136
+ }) => string | Promise<string>)
137
+ | Promise<string>;
138
+ /**
139
+ * Allows to overwrite the parameters used in the template
140
+ */
141
+ templateParameters?:
142
+ | false // Pass an empty object to the template function
143
+ | ((
144
+ compilation: Compilation,
145
+ assets: {
146
+ publicPath: string;
147
+ js: Array<string>;
148
+ css: Array<string>;
149
+ favicon?: string;
150
+ },
151
+ assetTags: {
152
+ headTags: HtmlTagObject[];
153
+ bodyTags: HtmlTagObject[];
154
+ },
155
+ options: ProcessedOptions,
156
+ ) => { [option: string]: any } | Promise<{ [option: string]: any }>)
157
+ | { [option: string]: any };
158
+ /**
159
+ * The title to use for the generated HTML document
160
+ */
161
+ title?: string;
162
+ /**
163
+ * Enforce self closing tags e.g. <link />
164
+ */
165
+ xhtml?: boolean;
166
+ /**
167
+ * In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through
168
+ * to your template.
169
+ */
170
+ [option: string]: any;
171
+ }
172
+
173
+ /**
174
+ * The plugin options after adding default values
175
+ */
176
+ interface ProcessedOptions extends Required<Options> {
177
+ minify?: Options['minify'];
178
+ }
179
+
180
+ /**
181
+ * The values which are available during template execution
182
+ *
183
+ * Please keep in mind that the `templateParameter` options allows to change them
184
+ */
185
+ interface TemplateParameter {
186
+ compilation: Compilation;
187
+ htmlWebpackPlugin: {
188
+ tags: {
189
+ headTags: HtmlTagObject[];
190
+ bodyTags: HtmlTagObject[];
191
+ };
192
+ files: {
193
+ publicPath: string;
194
+ js: Array<string>;
195
+ css: Array<string>;
196
+ favicon?: string;
197
+ };
198
+ options: Options;
199
+ };
200
+ webpackConfig: any;
201
+ }
202
+
203
+ interface Hooks {
204
+ alterAssetTags: AsyncSeriesWaterfallHook<{
205
+ assetTags: {
206
+ scripts: HtmlTagObject[];
207
+ styles: HtmlTagObject[];
208
+ meta: HtmlTagObject[];
209
+ };
210
+ publicPath: string;
211
+ outputName: string;
212
+ plugin: HtmlRspackPlugin;
213
+ }>;
214
+
215
+ alterAssetTagGroups: AsyncSeriesWaterfallHook<{
216
+ headTags: HtmlTagObject[];
217
+ bodyTags: HtmlTagObject[];
218
+ outputName: string;
219
+ publicPath: string;
220
+ plugin: HtmlRspackPlugin;
221
+ }>;
222
+
223
+ afterTemplateExecution: AsyncSeriesWaterfallHook<{
224
+ html: string;
225
+ headTags: HtmlTagObject[];
226
+ bodyTags: HtmlTagObject[];
227
+ outputName: string;
228
+ plugin: HtmlRspackPlugin;
229
+ }>;
230
+
231
+ beforeAssetTagGeneration: AsyncSeriesWaterfallHook<{
232
+ assets: {
233
+ publicPath: string;
234
+ js: Array<string>;
235
+ css: Array<string>;
236
+ favicon?: string;
237
+ };
238
+ outputName: string;
239
+ plugin: HtmlRspackPlugin;
240
+ }>;
241
+
242
+ beforeEmit: AsyncSeriesWaterfallHook<{
243
+ html: string;
244
+ outputName: string;
245
+ plugin: HtmlRspackPlugin;
246
+ }>;
247
+
248
+ afterEmit: AsyncSeriesWaterfallHook<{
249
+ outputName: string;
250
+ plugin: HtmlRspackPlugin;
251
+ }>;
252
+ }
253
+
254
+ /**
255
+ * A tag element according to the htmlWebpackPlugin object notation
256
+ */
257
+ interface HtmlTagObject {
258
+ /**
259
+ * Attributes of the html tag
260
+ * E.g. `{'disabled': true, 'value': 'demo'}`
261
+ */
262
+ attributes: {
263
+ [attributeName: string]: string | boolean | null | undefined;
264
+ };
265
+ /**
266
+ * The tag name e.g. `'div'`
267
+ */
268
+ tagName: string;
269
+ /**
270
+ * The inner HTML
271
+ */
272
+ innerHTML?: string;
273
+ /**
274
+ * Whether this html must not contain innerHTML
275
+ * @see https://www.w3.org/TR/html5/syntax.html#void-elements
276
+ */
277
+ voidTag: boolean;
278
+ /**
279
+ * Meta information about the tag
280
+ * E.g. `{'plugin': 'html-webpack-plugin'}`
281
+ */
282
+ meta: {
283
+ plugin?: string;
284
+ [metaAttributeName: string]: any;
285
+ };
286
+ }
287
+ }
288
+
289
+ export { HtmlRspackPlugin as default };