@storybook/builder-vite 8.6.0-alpha.5 → 8.6.0-beta.1
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 +17 -10
- package/dist/index.mjs +18 -11
- package/input/iframe.html +28 -1
- package/package.json +3 -3
package/input/iframe.html
CHANGED
|
@@ -64,6 +64,33 @@
|
|
|
64
64
|
<!-- [BODY HTML SNIPPET HERE] -->
|
|
65
65
|
<div id="storybook-root"></div>
|
|
66
66
|
<div id="storybook-docs"></div>
|
|
67
|
-
<script
|
|
67
|
+
<script>
|
|
68
|
+
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/naming-convention
|
|
69
|
+
function __onViteAppLoadingError(event) {
|
|
70
|
+
const hostname = globalThis.location.hostname;
|
|
71
|
+
if (hostname !== 'localhost' && globalThis.CONFIG_TYPE === 'DEVELOPMENT') {
|
|
72
|
+
const message = `Failed to load the Storybook preview file 'vite-app.js':
|
|
73
|
+
|
|
74
|
+
It looks like you're visiting the Storybook development server on another hostname than localhost: '${hostname}', but you haven't configured the necessary security features to support this.
|
|
75
|
+
Please re-run your Storybook development server with the '--host ${hostname}' flag, or manually configure your Vite allowedHosts configuration with viteFinal.
|
|
76
|
+
|
|
77
|
+
See:`;
|
|
78
|
+
const docs = [
|
|
79
|
+
'https://storybook.js.org/docs/api/cli-options#dev',
|
|
80
|
+
'https://storybook.js.org/docs/api/main-config/main-config-vite-final',
|
|
81
|
+
'https://vite.dev/config/server-options.html#server-allowedhosts',
|
|
82
|
+
];
|
|
83
|
+
console.error(`${message}\n${docs.map((doc) => `- ${doc}`).join('\n')}`);
|
|
84
|
+
|
|
85
|
+
document.getElementById('storybook-root').innerHTML =
|
|
86
|
+
`<p style="color: red; max-width: 70ch">${message.replaceAll(
|
|
87
|
+
'\n',
|
|
88
|
+
'<br/>'
|
|
89
|
+
)}<ul>${docs.map((doc) => `<li><a href='${doc}' target='_blank'>${doc}</a></li>`).join('')}<ul></p>`;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
<script type="module" src="virtual:/@storybook/builder-vite/vite-app.js" onerror="__onViteAppLoadingError(event)"></script>
|
|
68
95
|
</body>
|
|
69
96
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-vite",
|
|
3
|
-
"version": "8.6.0-
|
|
3
|
+
"version": "8.6.0-beta.1",
|
|
4
4
|
"description": "A plugin to run and build Storybooks with Vite",
|
|
5
5
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"prep": "jiti ../../../scripts/prepare/bundle.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@storybook/csf-plugin": "8.6.0-
|
|
46
|
+
"@storybook/csf-plugin": "8.6.0-beta.1",
|
|
47
47
|
"browser-assert": "^1.2.1",
|
|
48
48
|
"ts-dedent": "^2.0.0"
|
|
49
49
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vite": "^4.0.4"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"storybook": "^8.6.0-
|
|
65
|
+
"storybook": "^8.6.0-beta.1",
|
|
66
66
|
"vite": "^4.0.0 || ^5.0.0 || ^6.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|