@storybook/builder-vite 10.2.15 → 10.2.16
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_hxo4pbcr7oe from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hxo4pbcr7oe from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hxo4pbcr7oe.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hxo4pbcr7oe.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe.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_hxo4pbcr7oe from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hxo4pbcr7oe from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hxo4pbcr7oe.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hxo4pbcr7oe.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe.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-XHDWWTXW.js";
|
|
21
21
|
|
|
22
22
|
// ../../../node_modules/picocolors/picocolors.js
|
|
23
23
|
var require_picocolors = __commonJS({
|
|
@@ -1726,10 +1726,6 @@ async function build(options) {
|
|
|
1726
1726
|
)?.storybookGetStats();
|
|
1727
1727
|
}
|
|
1728
1728
|
|
|
1729
|
-
// src/vite-server.ts
|
|
1730
|
-
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
1731
|
-
import { dedent as dedent4 } from "ts-dedent";
|
|
1732
|
-
|
|
1733
1729
|
// src/optimizeDeps.ts
|
|
1734
1730
|
import { resolveConfig } from "vite";
|
|
1735
1731
|
|
|
@@ -1870,10 +1866,11 @@ async function getOptimizeDeps(config, options) {
|
|
|
1870
1866
|
|
|
1871
1867
|
// src/vite-server.ts
|
|
1872
1868
|
async function createViteServer(options, devServer) {
|
|
1873
|
-
let { presets } = options, commonCfg = await commonConfig(options, "development"), config = {
|
|
1869
|
+
let { presets } = options, commonCfg = await commonConfig(options, "development"), { allowedHosts } = await presets.apply("core", {}), config = {
|
|
1874
1870
|
...commonCfg,
|
|
1875
1871
|
// Set up dev server
|
|
1876
1872
|
server: {
|
|
1873
|
+
allowedHosts,
|
|
1877
1874
|
middlewareMode: !0,
|
|
1878
1875
|
hmr: {
|
|
1879
1876
|
port: options.port,
|
|
@@ -1886,14 +1883,7 @@ async function createViteServer(options, devServer) {
|
|
|
1886
1883
|
appType: "custom",
|
|
1887
1884
|
optimizeDeps: await getOptimizeDeps(commonCfg, options)
|
|
1888
1885
|
};
|
|
1889
|
-
options.host === "0.0.0.0" && !
|
|
1890
|
-
Defaulting 'allowedHosts' to true, which permits all hostnames.
|
|
1891
|
-
To restrict allowed hostnames, add the following to your 'viteFinal' config:
|
|
1892
|
-
Example: { server: { allowedHosts: ['mydomain.com'] } }
|
|
1893
|
-
See:
|
|
1894
|
-
- https://vite.dev/config/server-options.html#server-allowedhosts
|
|
1895
|
-
- https://storybook.js.org/docs/api/main-config/main-config-vite-final
|
|
1896
|
-
`));
|
|
1886
|
+
options.host === "0.0.0.0" && (!allowedHosts || Array.isArray(allowedHosts) && allowedHosts.length === 0) && (config.server.allowedHosts = !0);
|
|
1897
1887
|
let finalConfig = await presets.apply("viteFinal", config, options), { createServer } = await import("vite");
|
|
1898
1888
|
return finalConfig.customLogger ??= await createViteLogger(), createServer(await sanitizeEnvVars(options, finalConfig));
|
|
1899
1889
|
}
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hxo4pbcr7oe from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hxo4pbcr7oe from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hxo4pbcr7oe.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hxo4pbcr7oe.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hxo4pbcr7oe.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-XHDWWTXW.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.16",
|
|
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.16",
|
|
50
50
|
"ts-dedent": "^2.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"vite": "^7.0.4"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"storybook": "^10.2.
|
|
64
|
+
"storybook": "^10.2.16",
|
|
65
65
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|