storybook-builder-rsbuild 2.1.1 → 2.1.3
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 +12 -39
- package/dist/index.mjs +12 -39
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -366,9 +366,6 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
368
|
source: {
|
|
369
|
-
// TODO: Rspack doesn't support virtual modules yet, use cache dir instead
|
|
370
|
-
// we needed to explicitly set the module in `node_modules` to be compiled
|
|
371
|
-
include: [/[\\/]node_modules[\\/].*[\\/]storybook-config-entry\.js/],
|
|
372
369
|
define: {
|
|
373
370
|
...(0, import_common2.stringifyProcessEnvs)(envs),
|
|
374
371
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
|
@@ -392,41 +389,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
392
389
|
removeScriptTypeAttributes: false,
|
|
393
390
|
removeStyleLinkTypeAttributes: true,
|
|
394
391
|
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
|
-
}
|
|
392
|
+
}))
|
|
430
393
|
].filter(Boolean),
|
|
431
394
|
tools: {
|
|
432
395
|
rspack: (config, { addRules, appendPlugins, rspack: rspack2, mergeConfig }) => {
|
|
@@ -495,6 +458,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
495
458
|
].filter(Boolean)
|
|
496
459
|
);
|
|
497
460
|
config.experiments ??= {};
|
|
461
|
+
config.experiments.outputModule = false;
|
|
462
|
+
config.externalsType = "var";
|
|
463
|
+
config.output ??= {};
|
|
464
|
+
config.output.module = false;
|
|
465
|
+
config.output.chunkFormat = "array-push";
|
|
466
|
+
config.output.chunkLoading = "jsonp";
|
|
498
467
|
config.experiments = {
|
|
499
468
|
...config.experiments,
|
|
500
469
|
...lazyCompilationConfig
|
|
@@ -531,6 +500,10 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
531
500
|
}
|
|
532
501
|
}
|
|
533
502
|
});
|
|
503
|
+
rsbuildConfig.source ??= {};
|
|
504
|
+
rsbuildConfig.source.entry = {
|
|
505
|
+
main: [...entries ?? [], ...dynamicEntries]
|
|
506
|
+
};
|
|
534
507
|
return rsbuildConfig;
|
|
535
508
|
};
|
|
536
509
|
|
|
@@ -561,7 +534,7 @@ var getIsReactVersion18or19 = async (options) => {
|
|
|
561
534
|
var applyReactShims = async (config, options) => {
|
|
562
535
|
const isReactVersion18 = await getIsReactVersion18or19(options);
|
|
563
536
|
if (isReactVersion18) {
|
|
564
|
-
return
|
|
537
|
+
return {};
|
|
565
538
|
}
|
|
566
539
|
return {
|
|
567
540
|
resolve: {
|
package/dist/index.mjs
CHANGED
|
@@ -315,9 +315,6 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
317
|
source: {
|
|
318
|
-
// TODO: Rspack doesn't support virtual modules yet, use cache dir instead
|
|
319
|
-
// we needed to explicitly set the module in `node_modules` to be compiled
|
|
320
|
-
include: [/[\\/]node_modules[\\/].*[\\/]storybook-config-entry\.js/],
|
|
321
318
|
define: {
|
|
322
319
|
...stringifyProcessEnvs(envs),
|
|
323
320
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
|
@@ -341,41 +338,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
341
338
|
removeScriptTypeAttributes: false,
|
|
342
339
|
removeStyleLinkTypeAttributes: true,
|
|
343
340
|
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
|
-
}
|
|
341
|
+
}))
|
|
379
342
|
].filter(Boolean),
|
|
380
343
|
tools: {
|
|
381
344
|
rspack: (config, { addRules, appendPlugins, rspack: rspack2, mergeConfig }) => {
|
|
@@ -446,6 +409,12 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
446
409
|
].filter(Boolean)
|
|
447
410
|
);
|
|
448
411
|
config.experiments ??= {};
|
|
412
|
+
config.experiments.outputModule = false;
|
|
413
|
+
config.externalsType = "var";
|
|
414
|
+
config.output ??= {};
|
|
415
|
+
config.output.module = false;
|
|
416
|
+
config.output.chunkFormat = "array-push";
|
|
417
|
+
config.output.chunkLoading = "jsonp";
|
|
449
418
|
config.experiments = {
|
|
450
419
|
...config.experiments,
|
|
451
420
|
...lazyCompilationConfig
|
|
@@ -482,6 +451,10 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
|
482
451
|
}
|
|
483
452
|
}
|
|
484
453
|
});
|
|
454
|
+
rsbuildConfig.source ??= {};
|
|
455
|
+
rsbuildConfig.source.entry = {
|
|
456
|
+
main: [...entries ?? [], ...dynamicEntries]
|
|
457
|
+
};
|
|
485
458
|
return rsbuildConfig;
|
|
486
459
|
};
|
|
487
460
|
var getIsReactVersion18or19 = async (options) => {
|
|
@@ -508,7 +481,7 @@ var getIsReactVersion18or19 = async (options) => {
|
|
|
508
481
|
var applyReactShims = async (config, options) => {
|
|
509
482
|
const isReactVersion18 = await getIsReactVersion18or19(options);
|
|
510
483
|
if (isReactVersion18) {
|
|
511
|
-
return
|
|
484
|
+
return {};
|
|
512
485
|
}
|
|
513
486
|
return {
|
|
514
487
|
resolve: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-builder-rsbuild",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Rsbuild builder for Storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@rsbuild/plugin-type-check": "^1.2.4",
|
|
61
|
-
"@storybook/addon-docs": "^9.1.
|
|
62
|
-
"@storybook/core-webpack": "^9.1.
|
|
61
|
+
"@storybook/addon-docs": "^9.1.15",
|
|
62
|
+
"@storybook/core-webpack": "^9.1.15",
|
|
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.
|
|
69
|
-
"magic-string": "^0.30.
|
|
68
|
+
"fs-extra": "^11.3.2",
|
|
69
|
+
"magic-string": "^0.30.21",
|
|
70
70
|
"path-browserify": "^1.0.1",
|
|
71
71
|
"process": "^0.11.10",
|
|
72
72
|
"rsbuild-plugin-html-minifier-terser": "^1.1.2",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"util-deprecate": "^1.0.2"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@rsbuild/core": "^1.5.
|
|
80
|
+
"@rsbuild/core": "^1.5.17",
|
|
81
81
|
"@types/find-cache-dir": "^5.0.2",
|
|
82
82
|
"@types/fs-extra": "^11.0.4",
|
|
83
83
|
"@types/node": "^18.19.110",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"find-cache-dir": "^5.0.0",
|
|
86
86
|
"pretty-hrtime": "^1.0.3",
|
|
87
87
|
"slash": "^5.1.0",
|
|
88
|
-
"storybook": "9.1.
|
|
89
|
-
"typescript": "^5.9.
|
|
88
|
+
"storybook": "9.1.10",
|
|
89
|
+
"typescript": "^5.9.3"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@rsbuild/core": "^1.5.0",
|