@rsbuild/webpack 1.1.5 → 1.2.0-alpha.0

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.
@@ -1,5 +1,5 @@
1
1
  export const ids = [
2
- '863'
2
+ '240'
3
3
  ];
4
4
  export const modules = {
5
5
  "./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
3
  exports.ids = [
4
- '664'
4
+ '290'
5
5
  ], exports.modules = {
6
6
  "./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7
7
  __webpack_require__.d(__webpack_exports__, {
package/dist/index.cjs CHANGED
@@ -19,6 +19,9 @@ var __webpack_modules__ = {
19
19
  "copy-webpack-plugin": function(module) {
20
20
  module.exports = import("copy-webpack-plugin");
21
21
  },
22
+ "html-webpack-plugin": function(module) {
23
+ module.exports = import("html-webpack-plugin");
24
+ },
22
25
  "mini-css-extract-plugin": function(module) {
23
26
  module.exports = import("mini-css-extract-plugin");
24
27
  },
@@ -197,8 +200,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
197
200
  helpers
198
201
  })));
199
202
  if ('verbose' === core_.logger.level) {
200
- let inspect = ()=>{
201
- inspectConfig({
203
+ let inspect = async ()=>{
204
+ await inspectConfig({
202
205
  context,
203
206
  pluginManager,
204
207
  inspectOptions: {
@@ -210,8 +213,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
210
213
  helpers
211
214
  });
212
215
  };
213
- context.hooks.onBeforeBuild.tap(({ isFirstCompile })=>{
214
- isFirstCompile && inspect();
216
+ context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
217
+ isFirstCompile && await inspect();
215
218
  }), context.hooks.onAfterStartDevServer.tap(inspect);
216
219
  }
217
220
  return {
@@ -219,7 +222,6 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
219
222
  };
220
223
  }
221
224
  async function createCompiler_createCompiler(options) {
222
- var _context_normalizedConfig;
223
225
  core_.logger.debug('create compiler');
224
226
  let { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
225
227
  await context.hooks.onBeforeCreateCompiler.call({
@@ -237,7 +239,7 @@ async function createCompiler_createCompiler(options) {
237
239
  };
238
240
  return compiler.hooks.done.tap('rsbuild:done', (stats)=>{
239
241
  done(stats);
240
- }), (null === (_context_normalizedConfig = context.normalizedConfig) || void 0 === _context_normalizedConfig ? void 0 : _context_normalizedConfig.mode) === 'development' && helpers.registerDevHook({
242
+ }), 'dev' === context.command && helpers.registerDevHook({
241
243
  compiler,
242
244
  context,
243
245
  bundlerConfigs: webpackConfigs,
@@ -327,7 +329,7 @@ let getMainFields = (chain, target)=>{
327
329
  if (progress) {
328
330
  let { ProgressPlugin } = await Promise.all([
329
331
  __webpack_require__.e("997"),
330
- __webpack_require__.e("664")
332
+ __webpack_require__.e("290")
331
333
  ]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
332
334
  chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
333
335
  {
@@ -354,7 +356,10 @@ let getMainFields = (chain, target)=>{
354
356
  }
355
357
  }), webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
356
358
  let { default: cssExtractPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "mini-css-extract-plugin"));
357
- helpers.setCssExtractPlugin(cssExtractPlugin);
359
+ if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
360
+ let { default: htmlPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "html-webpack-plugin"));
361
+ helpers.setHTMLPlugin(htmlPlugin);
362
+ }
358
363
  let createCompiler = async ()=>(await createCompiler_createCompiler({
359
364
  context,
360
365
  pluginManager,
package/dist/index.js CHANGED
@@ -192,8 +192,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
192
192
  helpers
193
193
  })));
194
194
  if ('verbose' === core_.logger.level) {
195
- let inspect = ()=>{
196
- inspectConfig({
195
+ let inspect = async ()=>{
196
+ await inspectConfig({
197
197
  context,
198
198
  pluginManager,
199
199
  inspectOptions: {
@@ -205,8 +205,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
205
205
  helpers
206
206
  });
207
207
  };
208
- context.hooks.onBeforeBuild.tap(({ isFirstCompile })=>{
209
- isFirstCompile && inspect();
208
+ context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
209
+ isFirstCompile && await inspect();
210
210
  }), context.hooks.onAfterStartDevServer.tap(inspect);
211
211
  }
212
212
  return {
@@ -214,7 +214,6 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
214
214
  };
215
215
  }
216
216
  async function createCompiler_createCompiler(options) {
217
- var _context_normalizedConfig;
218
217
  core_.logger.debug('create compiler');
219
218
  let { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
220
219
  await context.hooks.onBeforeCreateCompiler.call({
@@ -232,7 +231,7 @@ async function createCompiler_createCompiler(options) {
232
231
  };
233
232
  return compiler.hooks.done.tap('rsbuild:done', (stats)=>{
234
233
  done(stats);
235
- }), (null === (_context_normalizedConfig = context.normalizedConfig) || void 0 === _context_normalizedConfig ? void 0 : _context_normalizedConfig.mode) === 'development' && helpers.registerDevHook({
234
+ }), 'dev' === context.command && helpers.registerDevHook({
236
235
  compiler,
237
236
  context,
238
237
  bundlerConfigs: webpackConfigs,
@@ -320,7 +319,7 @@ let getMainFields = (chain, target)=>{
320
319
  if (progress) {
321
320
  let { ProgressPlugin } = await Promise.all([
322
321
  __webpack_require__.e("997"),
323
- __webpack_require__.e("863")
322
+ __webpack_require__.e("240")
324
323
  ]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
325
324
  chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
326
325
  {
@@ -347,7 +346,10 @@ let getMainFields = (chain, target)=>{
347
346
  }
348
347
  }), webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
349
348
  let { default: cssExtractPlugin } = await import("mini-css-extract-plugin");
350
- helpers.setCssExtractPlugin(cssExtractPlugin);
349
+ if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
350
+ let { default: htmlPlugin } = await import("html-webpack-plugin");
351
+ helpers.setHTMLPlugin(htmlPlugin);
352
+ }
351
353
  let createCompiler = async ()=>(await createCompiler_createCompiler({
352
354
  context,
353
355
  pluginManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.1.5",
3
+ "version": "1.2.0-alpha.0",
4
4
  "homepage": "https://rsbuild.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,6 +24,7 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "copy-webpack-plugin": "11.0.0",
27
+ "html-webpack-plugin": "^5.6.3",
27
28
  "mini-css-extract-plugin": "2.9.2",
28
29
  "picocolors": "^1.1.1",
29
30
  "reduce-configs": "^1.1.0",
@@ -31,13 +32,13 @@
31
32
  "webpack": "^5.97.1"
32
33
  },
33
34
  "devDependencies": {
34
- "@rslib/core": "0.1.3",
35
- "@types/node": "^22.10.1",
35
+ "@rslib/core": "0.2.2",
36
+ "@types/node": "^22.10.2",
36
37
  "ansi-escapes": "4.3.2",
37
38
  "cli-truncate": "2.1.0",
38
39
  "patch-console": "1.0.0",
39
40
  "typescript": "^5.7.2",
40
- "@rsbuild/core": "1.1.9",
41
+ "@rsbuild/core": "1.2.0-alpha.0",
41
42
  "@scripts/test-helper": "1.0.1"
42
43
  },
43
44
  "peerDependencies": {