@storybook/builder-vite 10.2.18 → 10.2.19
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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_c2kp53oihdh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c2kp53oihdh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c2kp53oihdh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c2kp53oihdh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c2kp53oihdh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c2kp53oihdh.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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_c2kp53oihdh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c2kp53oihdh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c2kp53oihdh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c2kp53oihdh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c2kp53oihdh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c2kp53oihdh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
normalize,
|
|
18
18
|
relative,
|
|
19
19
|
resolve
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-2U6GWM2E.js";
|
|
21
21
|
|
|
22
22
|
// ../../../node_modules/picocolors/picocolors.js
|
|
23
23
|
var require_picocolors = __commonJS({
|
|
@@ -146,6 +146,23 @@ async function hasVitePlugins(plugins, names) {
|
|
|
146
146
|
return !1;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
// src/utils/vite-features.ts
|
|
150
|
+
import { version } from "vite";
|
|
151
|
+
var shouldUseRolldownOptions = () => {
|
|
152
|
+
try {
|
|
153
|
+
return Number(version.split(".")[0]) >= 8;
|
|
154
|
+
} catch {
|
|
155
|
+
return !1;
|
|
156
|
+
}
|
|
157
|
+
}, bundlerOptionsKey = shouldUseRolldownOptions() ? "rolldownOptions" : "rollupOptions";
|
|
158
|
+
function ensureRolldownOptions(config) {
|
|
159
|
+
if (!shouldUseRolldownOptions())
|
|
160
|
+
return;
|
|
161
|
+
config.build ??= {};
|
|
162
|
+
let rolldown = config.build.rolldownOptions ??= {}, output = rolldown.output ??= {};
|
|
163
|
+
output.strictExecutionOrder = !0;
|
|
164
|
+
}
|
|
165
|
+
|
|
149
166
|
// src/utils/without-vite-plugins.ts
|
|
150
167
|
var withoutVitePlugins = async (plugins = [], namesToRemove) => {
|
|
151
168
|
let result = [], resolvedPlugins = await Promise.all(plugins);
|
|
@@ -1368,10 +1385,14 @@ function codeGeneratorPlugin(options) {
|
|
|
1368
1385
|
});
|
|
1369
1386
|
},
|
|
1370
1387
|
config(config, { command }) {
|
|
1371
|
-
command === "build"
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1388
|
+
if (command === "build") {
|
|
1389
|
+
config.build || (config.build = {});
|
|
1390
|
+
let build3 = config.build;
|
|
1391
|
+
build3[bundlerOptionsKey] = {
|
|
1392
|
+
...build3[bundlerOptionsKey],
|
|
1393
|
+
input: iframePath
|
|
1394
|
+
}, ensureRolldownOptions(config);
|
|
1395
|
+
}
|
|
1375
1396
|
},
|
|
1376
1397
|
configResolved(config) {
|
|
1377
1398
|
projectRoot = config.root, iframeId = `${config.root}/iframe.html`;
|
|
@@ -1680,7 +1701,8 @@ async function build(options) {
|
|
|
1680
1701
|
outDir: options.outputDir,
|
|
1681
1702
|
emptyOutDir: !1,
|
|
1682
1703
|
// do not clean before running Vite build - Storybook has already added assets in there!
|
|
1683
|
-
|
|
1704
|
+
// TODO: Remove bundlerOptionsKey and use 'rolldownOptions' directly once support for Vite < 8 is dropped
|
|
1705
|
+
[bundlerOptionsKey]: {
|
|
1684
1706
|
external: [/\.\/sb-common-assets\/.*\.woff2/]
|
|
1685
1707
|
},
|
|
1686
1708
|
...options.test ? {
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_c2kp53oihdh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c2kp53oihdh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c2kp53oihdh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c2kp53oihdh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c2kp53oihdh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c2kp53oihdh.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
|
normalize
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-2U6GWM2E.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
17
|
import { findConfigFile } from "storybook/internal/common";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-vite",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.19",
|
|
4
4
|
"description": "A Storybook builder to dev and build with Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"!src/**/*"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@storybook/csf-plugin": "10.2.
|
|
49
|
+
"@storybook/csf-plugin": "10.2.19",
|
|
50
50
|
"ts-dedent": "^2.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"vite": "^7.0.4"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"storybook": "^10.2.
|
|
65
|
-
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
64
|
+
"storybook": "^10.2.19",
|
|
65
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|