storybook-builder-rsbuild 0.0.6-beta.2 → 0.0.6-beta.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.d.ts +1 -2
- package/dist/index.js +7 -3
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as _storybook_core_webpack from '@storybook/core-webpack';
|
2
1
|
import * as rsbuildReal from '@rsbuild/core';
|
3
2
|
import { RsbuildConfig } from '@rsbuild/core';
|
4
3
|
import { TypescriptOptions as TypescriptOptions$1, Builder, Options, BuilderResult as BuilderResult$1, NormalizedStoriesSpecifier } from 'storybook/internal/types';
|
@@ -55,7 +54,7 @@ type BuilderStartOptions = Parameters<RsbuildBuilder['start']>['0'];
|
|
55
54
|
declare const executor: {
|
56
55
|
get: (options: Options) => Promise<typeof rsbuildReal>;
|
57
56
|
};
|
58
|
-
declare const rsbuild: (_: unknown, options: RsbuildBuilderOptions) => Promise<
|
57
|
+
declare const rsbuild: (_: unknown, options: RsbuildBuilderOptions) => Promise<rsbuildReal.RsbuildConfig>;
|
59
58
|
declare const getConfig: RsbuildBuilder['getConfig'];
|
60
59
|
declare function bail(): Promise<void>;
|
61
60
|
declare const start: RsbuildBuilder['start'];
|
package/dist/index.js
CHANGED
@@ -460,6 +460,10 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
460
460
|
config.optimization.runtimeChunk = true;
|
461
461
|
config.optimization.usedExports = options.build?.test?.disableTreeShaking ? false : isProd;
|
462
462
|
config.optimization.moduleIds = "named";
|
463
|
+
config.module ??= {};
|
464
|
+
config.module.parser ??= {};
|
465
|
+
config.module.parser.javascript ??= {};
|
466
|
+
config.module.parser.javascript.exportsPresence = false;
|
463
467
|
appendPlugins(
|
464
468
|
[
|
465
469
|
new rspack.ProvidePlugin({
|
@@ -555,7 +559,7 @@ var applyReactShims = async (config, options) => {
|
|
555
559
|
|
556
560
|
// src/index.ts
|
557
561
|
var import_pretty_hrtime = __toESM(require_pretty_hrtime());
|
558
|
-
var
|
562
|
+
var import_core2 = require("@rsbuild/core");
|
559
563
|
var printDuration = (startTime) => (0, import_pretty_hrtime.default)(process.hrtime(startTime)).replace(" ms", " milliseconds").replace(" s", " seconds").replace(" m", " minutes");
|
560
564
|
var executor = {
|
561
565
|
get: async (options) => {
|
@@ -567,13 +571,13 @@ var rsbuild = async (_, options) => {
|
|
567
571
|
const { presets } = options;
|
568
572
|
let defaultConfig = await iframe_rsbuild_config_default(options);
|
569
573
|
const shimsConfig = await applyReactShims(defaultConfig, options);
|
570
|
-
defaultConfig = (0,
|
574
|
+
defaultConfig = (0, import_core2.mergeRsbuildConfig)(defaultConfig, shimsConfig);
|
571
575
|
const finalDefaultConfig = await presets.apply(
|
572
576
|
"rsbuildFinal",
|
573
577
|
defaultConfig,
|
574
578
|
options
|
575
579
|
);
|
576
|
-
return (0,
|
580
|
+
return (0, import_core2.mergeRsbuildConfig)(finalDefaultConfig);
|
577
581
|
};
|
578
582
|
var getConfig = async (options) => {
|
579
583
|
const { presets } = options;
|
package/dist/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __commonJS, __toESM, __require } from './chunk-TTFRSOOU.mjs';
|
2
2
|
import * as rsbuildReal from '@rsbuild/core';
|
3
|
-
import {
|
3
|
+
import { mergeRsbuildConfig, loadConfig } from '@rsbuild/core';
|
4
4
|
import path, { join, resolve, parse, dirname, isAbsolute } from 'path';
|
5
5
|
import express from 'express';
|
6
6
|
import fs2 from 'fs-extra';
|
@@ -10,7 +10,7 @@ import { globalsNameReferenceMap } from 'storybook/internal/preview/globals';
|
|
10
10
|
import { normalizeStories, loadPreviewOrConfigFile, handlebars, readTemplate, getBuilderOptions, stringifyProcessEnvs, isPreservingSymlinks } from 'storybook/internal/common';
|
11
11
|
import { dedent } from 'ts-dedent';
|
12
12
|
import fs from 'fs';
|
13
|
-
import { webpackIncludeRegexp
|
13
|
+
import { webpackIncludeRegexp } from '@storybook/core-webpack';
|
14
14
|
import { webpack } from '@storybook/addon-docs/dist/preset';
|
15
15
|
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
|
16
16
|
import { pluginHtmlMinifierTerser } from 'rsbuild-plugin-html-minifier-terser';
|
@@ -403,6 +403,10 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
403
403
|
config.optimization.runtimeChunk = true;
|
404
404
|
config.optimization.usedExports = options.build?.test?.disableTreeShaking ? false : isProd;
|
405
405
|
config.optimization.moduleIds = "named";
|
406
|
+
config.module ??= {};
|
407
|
+
config.module.parser ??= {};
|
408
|
+
config.module.parser.javascript ??= {};
|
409
|
+
config.module.parser.javascript.exportsPresence = false;
|
406
410
|
appendPlugins(
|
407
411
|
[
|
408
412
|
new rspack.ProvidePlugin({
|
@@ -502,13 +506,13 @@ var rsbuild = async (_, options) => {
|
|
502
506
|
const { presets } = options;
|
503
507
|
let defaultConfig = await iframe_rsbuild_config_default(options);
|
504
508
|
const shimsConfig = await applyReactShims(defaultConfig, options);
|
505
|
-
defaultConfig =
|
509
|
+
defaultConfig = mergeRsbuildConfig(defaultConfig, shimsConfig);
|
506
510
|
const finalDefaultConfig = await presets.apply(
|
507
511
|
"rsbuildFinal",
|
508
512
|
defaultConfig,
|
509
513
|
options
|
510
514
|
);
|
511
|
-
return
|
515
|
+
return mergeRsbuildConfig(finalDefaultConfig);
|
512
516
|
};
|
513
517
|
var getConfig = async (options) => {
|
514
518
|
const { presets } = options;
|