@storybook/builder-vite 10.1.0-alpha.0 → 10.1.0-alpha.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 +13 -12
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_92w51qfdvvf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_92w51qfdvvf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_92w51qfdvvf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_92w51qfdvvf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_92w51qfdvvf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_92w51qfdvvf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -9076,7 +9076,11 @@ async function csfPlugin(config) {
|
|
|
9076
9076
|
// @ts-expect-error - not sure what type to use here
|
|
9077
9077
|
addons.find((a) => [a, a.name].includes("@storybook/addon-docs"))?.options ?? {}
|
|
9078
9078
|
);
|
|
9079
|
-
|
|
9079
|
+
const enrichCsf = await presets.apply("experimental_enrichCsf");
|
|
9080
|
+
return vite({
|
|
9081
|
+
...docsOptions?.csfPluginOptions,
|
|
9082
|
+
enrichCsf
|
|
9083
|
+
});
|
|
9080
9084
|
}
|
|
9081
9085
|
__name(csfPlugin, "csfPlugin");
|
|
9082
9086
|
|
|
@@ -9593,17 +9597,14 @@ async function getOptimizeDeps(config, options) {
|
|
|
9593
9597
|
const stories = absoluteStories.map((storyPath) => normalizePath(relative3(root, storyPath)));
|
|
9594
9598
|
const resolvedConfig = await resolveConfig(config, "serve", "development");
|
|
9595
9599
|
const resolve4 = resolvedConfig.createResolver({ asSrc: false });
|
|
9596
|
-
const include = await asyncFilter(
|
|
9597
|
-
Array.from(/* @__PURE__ */ new Set([...INCLUDE_CANDIDATES, ...extraOptimizeDeps])),
|
|
9598
|
-
async (id) => Boolean(await resolve4(id))
|
|
9599
|
-
);
|
|
9600
|
+
const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve4(id)));
|
|
9600
9601
|
const optimizeDeps = {
|
|
9601
9602
|
...config.optimizeDeps,
|
|
9602
9603
|
// We don't need to resolve the glob since vite supports globs for entries.
|
|
9603
9604
|
entries: stories,
|
|
9604
9605
|
// We need Vite to precompile these dependencies, because they contain non-ESM code that would break
|
|
9605
9606
|
// if we served it directly to the browser.
|
|
9606
|
-
include: [...include, ...config.optimizeDeps?.include || []]
|
|
9607
|
+
include: [...include, ...extraOptimizeDeps, ...config.optimizeDeps?.include || []]
|
|
9607
9608
|
};
|
|
9608
9609
|
return optimizeDeps;
|
|
9609
9610
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-vite",
|
|
3
|
-
"version": "10.1.0-alpha.
|
|
3
|
+
"version": "10.1.0-alpha.2",
|
|
4
4
|
"description": "A Storybook builder to dev and build with Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@storybook/csf-plugin": "10.1.0-alpha.
|
|
51
|
+
"@storybook/csf-plugin": "10.1.0-alpha.2",
|
|
52
52
|
"ts-dedent": "^2.0.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vite": "^7.0.4"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"storybook": "^10.1.0-alpha.
|
|
66
|
+
"storybook": "^10.1.0-alpha.2",
|
|
67
67
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|