@rsbuild/webpack 1.1.4 → 1.1.6

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,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
- '638'
4
+ '664'
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__, {
@@ -1,5 +1,5 @@
1
1
  export const ids = [
2
- '778'
2
+ '863'
3
3
  ];
4
4
  export const modules = {
5
5
  "./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
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
  },
@@ -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("638")
332
+ __webpack_require__.e("664")
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
@@ -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("778")
322
+ __webpack_require__.e("863")
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.4",
3
+ "version": "1.1.6",
4
4
  "homepage": "https://rsbuild.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,20 +24,21 @@
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",
30
31
  "tsconfig-paths-webpack-plugin": "4.2.0",
31
- "webpack": "^5.96.1"
32
+ "webpack": "^5.97.1"
32
33
  },
33
34
  "devDependencies": {
34
- "@rslib/core": "0.1.0",
35
- "@types/node": "^22.10.0",
35
+ "@rslib/core": "0.1.3",
36
+ "@types/node": "^22.10.1",
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.7",
41
+ "@rsbuild/core": "1.1.10",
41
42
  "@scripts/test-helper": "1.0.1"
42
43
  },
43
44
  "peerDependencies": {