storybook-builder-rsbuild 2.1.1 → 2.1.2

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.
package/dist/index.js CHANGED
@@ -365,7 +365,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
365
365
  ...storybookPaths
366
366
  }
367
367
  },
368
+ // Reset `config.source.entry` field, do not use provided entry
369
+ // see https://github.com/rspack-contrib/storybook-rsbuild/issues/43
368
370
  source: {
371
+ entry: {
372
+ main: [...entries ?? [], ...dynamicEntries]
373
+ },
369
374
  // TODO: Rspack doesn't support virtual modules yet, use cache dir instead
370
375
  // we needed to explicitly set the module in `node_modules` to be compiled
371
376
  include: [/[\\/]node_modules[\\/].*[\\/]storybook-config-entry\.js/],
@@ -392,41 +397,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
392
397
  removeScriptTypeAttributes: false,
393
398
  removeStyleLinkTypeAttributes: true,
394
399
  useShortDoctype: true
395
- })),
396
- {
397
- name: "storybook-config-entry",
398
- setup: (api) => {
399
- api.modifyEnvironmentConfig({
400
- handler: (config, { mergeEnvironmentConfig }) => {
401
- const baseConfig = { ...config };
402
- delete baseConfig.source.entry;
403
- return mergeEnvironmentConfig(config, {
404
- // Reset `config.source.entry` field, do not use provided entry
405
- // see https://github.com/rspack-contrib/storybook-rsbuild/issues/43
406
- source: {
407
- entry: {
408
- main: [...entries ?? [], ...dynamicEntries]
409
- }
410
- },
411
- tools: {
412
- rspack: {
413
- experiments: {
414
- outputModule: false
415
- },
416
- externalsType: "var",
417
- output: {
418
- module: false,
419
- chunkFormat: "array-push",
420
- chunkLoading: "jsonp"
421
- }
422
- }
423
- }
424
- });
425
- },
426
- order: "post"
427
- });
428
- }
429
- }
400
+ }))
430
401
  ].filter(Boolean),
431
402
  tools: {
432
403
  rspack: (config, { addRules, appendPlugins, rspack: rspack2, mergeConfig }) => {
@@ -495,6 +466,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
495
466
  ].filter(Boolean)
496
467
  );
497
468
  config.experiments ??= {};
469
+ config.experiments.outputModule = false;
470
+ config.externalsType = "var";
471
+ config.output ??= {};
472
+ config.output.module = false;
473
+ config.output.chunkFormat = "array-push";
474
+ config.output.chunkLoading = "jsonp";
498
475
  config.experiments = {
499
476
  ...config.experiments,
500
477
  ...lazyCompilationConfig
package/dist/index.mjs CHANGED
@@ -314,7 +314,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
314
314
  ...storybookPaths
315
315
  }
316
316
  },
317
+ // Reset `config.source.entry` field, do not use provided entry
318
+ // see https://github.com/rspack-contrib/storybook-rsbuild/issues/43
317
319
  source: {
320
+ entry: {
321
+ main: [...entries ?? [], ...dynamicEntries]
322
+ },
318
323
  // TODO: Rspack doesn't support virtual modules yet, use cache dir instead
319
324
  // we needed to explicitly set the module in `node_modules` to be compiled
320
325
  include: [/[\\/]node_modules[\\/].*[\\/]storybook-config-entry\.js/],
@@ -341,41 +346,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
341
346
  removeScriptTypeAttributes: false,
342
347
  removeStyleLinkTypeAttributes: true,
343
348
  useShortDoctype: true
344
- })),
345
- {
346
- name: "storybook-config-entry",
347
- setup: (api) => {
348
- api.modifyEnvironmentConfig({
349
- handler: (config, { mergeEnvironmentConfig }) => {
350
- const baseConfig = { ...config };
351
- delete baseConfig.source.entry;
352
- return mergeEnvironmentConfig(config, {
353
- // Reset `config.source.entry` field, do not use provided entry
354
- // see https://github.com/rspack-contrib/storybook-rsbuild/issues/43
355
- source: {
356
- entry: {
357
- main: [...entries ?? [], ...dynamicEntries]
358
- }
359
- },
360
- tools: {
361
- rspack: {
362
- experiments: {
363
- outputModule: false
364
- },
365
- externalsType: "var",
366
- output: {
367
- module: false,
368
- chunkFormat: "array-push",
369
- chunkLoading: "jsonp"
370
- }
371
- }
372
- }
373
- });
374
- },
375
- order: "post"
376
- });
377
- }
378
- }
349
+ }))
379
350
  ].filter(Boolean),
380
351
  tools: {
381
352
  rspack: (config, { addRules, appendPlugins, rspack: rspack2, mergeConfig }) => {
@@ -446,6 +417,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
446
417
  ].filter(Boolean)
447
418
  );
448
419
  config.experiments ??= {};
420
+ config.experiments.outputModule = false;
421
+ config.externalsType = "var";
422
+ config.output ??= {};
423
+ config.output.module = false;
424
+ config.output.chunkFormat = "array-push";
425
+ config.output.chunkLoading = "jsonp";
449
426
  config.experiments = {
450
427
  ...config.experiments,
451
428
  ...lazyCompilationConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-builder-rsbuild",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Rsbuild builder for Storybook",
5
5
  "keywords": [
6
6
  "storybook",
@@ -58,14 +58,14 @@
58
58
  ],
59
59
  "dependencies": {
60
60
  "@rsbuild/plugin-type-check": "^1.2.4",
61
- "@storybook/addon-docs": "^9.1.5",
62
- "@storybook/core-webpack": "^9.1.5",
61
+ "@storybook/addon-docs": "^9.1.7",
62
+ "@storybook/core-webpack": "^9.1.7",
63
63
  "browser-assert": "^1.2.1",
64
64
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
65
65
  "cjs-module-lexer": "^1.4.3",
66
66
  "constants-browserify": "^1.0.0",
67
67
  "es-module-lexer": "^1.7.0",
68
- "fs-extra": "^11.3.1",
68
+ "fs-extra": "^11.3.2",
69
69
  "magic-string": "^0.30.19",
70
70
  "path-browserify": "^1.0.1",
71
71
  "process": "^0.11.10",
@@ -77,7 +77,7 @@
77
77
  "util-deprecate": "^1.0.2"
78
78
  },
79
79
  "devDependencies": {
80
- "@rsbuild/core": "^1.5.6",
80
+ "@rsbuild/core": "^1.5.11",
81
81
  "@types/find-cache-dir": "^5.0.2",
82
82
  "@types/fs-extra": "^11.0.4",
83
83
  "@types/node": "^18.19.110",