@storybook/builder-webpack5 10.0.0 → 10.0.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/_node-chunks/{chunk-EH7J2B3V.js → chunk-7STRQEPM.js} +7 -7
- package/dist/_node-chunks/{chunk-ZCIHESPC.js → chunk-G36HOTLQ.js} +6 -6
- package/dist/index.js +170 -16
- package/dist/loaders/export-order-loader.js +7 -7
- package/dist/presets/custom-webpack-preset.js +7 -7
- package/dist/presets/preview-preset.js +8 -8
- package/package.json +3 -3
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-G36HOTLQ.js";
|
|
15
15
|
|
|
16
16
|
// src/preview/virtual-module-mapping.ts
|
|
17
17
|
import { join, resolve } from "node:path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
getVirtualModules
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-7STRQEPM.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__name,
|
|
18
18
|
__require,
|
|
19
19
|
__toESM
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-G36HOTLQ.js";
|
|
21
21
|
|
|
22
22
|
// ../../node_modules/pretty-hrtime/index.js
|
|
23
23
|
var require_pretty_hrtime = __commonJS({
|
|
@@ -94,10 +94,10 @@ var require_pretty_hrtime = __commonJS({
|
|
|
94
94
|
// ../../node_modules/totalist/sync/index.js
|
|
95
95
|
var require_sync = __commonJS({
|
|
96
96
|
"../../node_modules/totalist/sync/index.js"(exports) {
|
|
97
|
-
var { join: join2, resolve } = __require("path");
|
|
97
|
+
var { join: join2, resolve: resolve2 } = __require("path");
|
|
98
98
|
var { readdirSync, statSync } = __require("fs");
|
|
99
99
|
function totalist(dir, callback, pre = "") {
|
|
100
|
-
dir =
|
|
100
|
+
dir = resolve2(".", dir);
|
|
101
101
|
let arr = readdirSync(dir);
|
|
102
102
|
let i = 0, abs, stats;
|
|
103
103
|
for (; i < arr.length; i++) {
|
|
@@ -601,7 +601,7 @@ var require_mrmime = __commonJS({
|
|
|
601
601
|
var require_build2 = __commonJS({
|
|
602
602
|
"../../node_modules/sirv/build.js"(exports, module) {
|
|
603
603
|
var fs = __require("fs");
|
|
604
|
-
var { join: join2, normalize, resolve } = __require("path");
|
|
604
|
+
var { join: join2, normalize: normalize2, resolve: resolve2 } = __require("path");
|
|
605
605
|
var { totalist } = require_sync();
|
|
606
606
|
var { parse: parse2 } = require_build();
|
|
607
607
|
var { lookup } = require_mrmime();
|
|
@@ -638,7 +638,7 @@ var require_build2 = __commonJS({
|
|
|
638
638
|
let i = 0, arr = toAssume(uri, extns);
|
|
639
639
|
let abs, stats, name, headers;
|
|
640
640
|
for (; i < arr.length; i++) {
|
|
641
|
-
abs =
|
|
641
|
+
abs = normalize2(join2(dir, name = arr[i]));
|
|
642
642
|
if (abs.startsWith(dir) && fs.existsSync(abs)) {
|
|
643
643
|
stats = fs.statSync(abs);
|
|
644
644
|
if (stats.isDirectory()) continue;
|
|
@@ -703,7 +703,7 @@ var require_build2 = __commonJS({
|
|
|
703
703
|
}
|
|
704
704
|
__name(toHeaders, "toHeaders");
|
|
705
705
|
module.exports = function(dir, opts = {}) {
|
|
706
|
-
dir =
|
|
706
|
+
dir = resolve2(dir || ".");
|
|
707
707
|
let isNotFound = opts.onNoMatch || is404;
|
|
708
708
|
let setHeaders = opts.setHeaders || noop;
|
|
709
709
|
let extensions = opts.extensions || ["html", "htm"];
|
|
@@ -769,10 +769,7 @@ var require_build2 = __commonJS({
|
|
|
769
769
|
});
|
|
770
770
|
|
|
771
771
|
// src/index.ts
|
|
772
|
-
var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
|
|
773
|
-
var import_sirv = __toESM(require_build2(), 1);
|
|
774
772
|
import { cp } from "node:fs/promises";
|
|
775
|
-
import { dirname, join, parse } from "node:path";
|
|
776
773
|
import { fileURLToPath } from "node:url";
|
|
777
774
|
import { PREVIEW_BUILDER_PROGRESS } from "storybook/internal/core-events";
|
|
778
775
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -782,6 +779,163 @@ import {
|
|
|
782
779
|
WebpackMissingStatsError
|
|
783
780
|
} from "storybook/internal/server-errors";
|
|
784
781
|
import { checkWebpackVersion } from "@storybook/core-webpack";
|
|
782
|
+
|
|
783
|
+
// ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
784
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
785
|
+
function normalizeWindowsPath(input = "") {
|
|
786
|
+
if (!input) {
|
|
787
|
+
return input;
|
|
788
|
+
}
|
|
789
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
790
|
+
}
|
|
791
|
+
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
792
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
793
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
794
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
795
|
+
var normalize = /* @__PURE__ */ __name(function(path2) {
|
|
796
|
+
if (path2.length === 0) {
|
|
797
|
+
return ".";
|
|
798
|
+
}
|
|
799
|
+
path2 = normalizeWindowsPath(path2);
|
|
800
|
+
const isUNCPath = path2.match(_UNC_REGEX);
|
|
801
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
802
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
803
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
804
|
+
if (path2.length === 0) {
|
|
805
|
+
if (isPathAbsolute) {
|
|
806
|
+
return "/";
|
|
807
|
+
}
|
|
808
|
+
return trailingSeparator ? "./" : ".";
|
|
809
|
+
}
|
|
810
|
+
if (trailingSeparator) {
|
|
811
|
+
path2 += "/";
|
|
812
|
+
}
|
|
813
|
+
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
814
|
+
path2 += "/";
|
|
815
|
+
}
|
|
816
|
+
if (isUNCPath) {
|
|
817
|
+
if (!isPathAbsolute) {
|
|
818
|
+
return `//./${path2}`;
|
|
819
|
+
}
|
|
820
|
+
return `//${path2}`;
|
|
821
|
+
}
|
|
822
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
823
|
+
}, "normalize");
|
|
824
|
+
var join = /* @__PURE__ */ __name(function(...arguments_) {
|
|
825
|
+
if (arguments_.length === 0) {
|
|
826
|
+
return ".";
|
|
827
|
+
}
|
|
828
|
+
let joined;
|
|
829
|
+
for (const argument of arguments_) {
|
|
830
|
+
if (argument && argument.length > 0) {
|
|
831
|
+
if (joined === void 0) {
|
|
832
|
+
joined = argument;
|
|
833
|
+
} else {
|
|
834
|
+
joined += `/${argument}`;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if (joined === void 0) {
|
|
839
|
+
return ".";
|
|
840
|
+
}
|
|
841
|
+
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
842
|
+
}, "join");
|
|
843
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
844
|
+
let res = "";
|
|
845
|
+
let lastSegmentLength = 0;
|
|
846
|
+
let lastSlash = -1;
|
|
847
|
+
let dots = 0;
|
|
848
|
+
let char = null;
|
|
849
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
850
|
+
if (index < path2.length) {
|
|
851
|
+
char = path2[index];
|
|
852
|
+
} else if (char === "/") {
|
|
853
|
+
break;
|
|
854
|
+
} else {
|
|
855
|
+
char = "/";
|
|
856
|
+
}
|
|
857
|
+
if (char === "/") {
|
|
858
|
+
if (lastSlash === index - 1 || dots === 1) ;
|
|
859
|
+
else if (dots === 2) {
|
|
860
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
861
|
+
if (res.length > 2) {
|
|
862
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
863
|
+
if (lastSlashIndex === -1) {
|
|
864
|
+
res = "";
|
|
865
|
+
lastSegmentLength = 0;
|
|
866
|
+
} else {
|
|
867
|
+
res = res.slice(0, lastSlashIndex);
|
|
868
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
869
|
+
}
|
|
870
|
+
lastSlash = index;
|
|
871
|
+
dots = 0;
|
|
872
|
+
continue;
|
|
873
|
+
} else if (res.length > 0) {
|
|
874
|
+
res = "";
|
|
875
|
+
lastSegmentLength = 0;
|
|
876
|
+
lastSlash = index;
|
|
877
|
+
dots = 0;
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
if (allowAboveRoot) {
|
|
882
|
+
res += res.length > 0 ? "/.." : "..";
|
|
883
|
+
lastSegmentLength = 2;
|
|
884
|
+
}
|
|
885
|
+
} else {
|
|
886
|
+
if (res.length > 0) {
|
|
887
|
+
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
888
|
+
} else {
|
|
889
|
+
res = path2.slice(lastSlash + 1, index);
|
|
890
|
+
}
|
|
891
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
892
|
+
}
|
|
893
|
+
lastSlash = index;
|
|
894
|
+
dots = 0;
|
|
895
|
+
} else if (char === "." && dots !== -1) {
|
|
896
|
+
++dots;
|
|
897
|
+
} else {
|
|
898
|
+
dots = -1;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
return res;
|
|
902
|
+
}
|
|
903
|
+
__name(normalizeString, "normalizeString");
|
|
904
|
+
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
905
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
906
|
+
}, "isAbsolute");
|
|
907
|
+
var _EXTNAME_RE = /.(\.[^./]+)$/;
|
|
908
|
+
var extname = /* @__PURE__ */ __name(function(p) {
|
|
909
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
910
|
+
return match && match[1] || "";
|
|
911
|
+
}, "extname");
|
|
912
|
+
var dirname = /* @__PURE__ */ __name(function(p) {
|
|
913
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
914
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
915
|
+
segments[0] += "/";
|
|
916
|
+
}
|
|
917
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
918
|
+
}, "dirname");
|
|
919
|
+
var basename = /* @__PURE__ */ __name(function(p, extension) {
|
|
920
|
+
const lastSegment = normalizeWindowsPath(p).split("/").pop();
|
|
921
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
922
|
+
}, "basename");
|
|
923
|
+
var parse = /* @__PURE__ */ __name(function(p) {
|
|
924
|
+
const root = normalizeWindowsPath(p).split("/").shift() || "/";
|
|
925
|
+
const base = basename(p);
|
|
926
|
+
const extension = extname(base);
|
|
927
|
+
return {
|
|
928
|
+
root,
|
|
929
|
+
dir: dirname(p),
|
|
930
|
+
base,
|
|
931
|
+
ext: extension,
|
|
932
|
+
name: base.slice(0, base.length - extension.length)
|
|
933
|
+
};
|
|
934
|
+
}, "parse");
|
|
935
|
+
|
|
936
|
+
// src/index.ts
|
|
937
|
+
var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
|
|
938
|
+
var import_sirv = __toESM(require_build2(), 1);
|
|
785
939
|
import webpackModule from "webpack";
|
|
786
940
|
import webpackDevMiddleware from "webpack-dev-middleware";
|
|
787
941
|
import webpackHotMiddleware from "webpack-hot-middleware";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-G36HOTLQ.js";
|
|
15
15
|
|
|
16
16
|
// src/loaders/export-order-loader.ts
|
|
17
17
|
import assert from "node:assert";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-G36HOTLQ.js";
|
|
15
15
|
|
|
16
16
|
// src/presets/custom-webpack-preset.ts
|
|
17
17
|
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zxpo9ucpko from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zxpo9ucpko from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zxpo9ucpko from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zxpo9ucpko.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zxpo9ucpko.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zxpo9ucpko.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
getVirtualModules
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-7STRQEPM.js";
|
|
15
15
|
import {
|
|
16
16
|
__name
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-G36HOTLQ.js";
|
|
18
18
|
|
|
19
19
|
// src/presets/preview-preset.ts
|
|
20
20
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-webpack5",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "A Storybook builder to dev and build with Webpack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@storybook/core-webpack": "10.0.
|
|
56
|
+
"@storybook/core-webpack": "10.0.2",
|
|
57
57
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
58
58
|
"cjs-module-lexer": "^1.2.3",
|
|
59
59
|
"css-loader": "^7.1.2",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"typescript": "^5.8.3"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"storybook": "^10.0.
|
|
82
|
+
"storybook": "^10.0.2"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"typescript": {
|