Skip to content

Commit 1c93eb2

Browse files
committed
feat(storybook-builder): bundle preview assets
1 parent e611720 commit 1c93eb2

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.changeset/tricky-sloths-retire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@web/storybook-builder': patch
3+
---
4+
5+
extract and bundle preview assets

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/storybook-builder/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@web/dev-server": "^0.4.0",
5757
"@web/dev-server-core": "^0.7.0",
5858
"@web/dev-server-rollup": "^0.6.1",
59-
"@web/rollup-plugin-html": "^2.1.2",
59+
"@web/rollup-plugin-html": "^2.3.0",
6060
"browser-assert": "^1.2.1",
6161
"es-module-lexer": "^1.2.1",
6262
"esbuild": "^0.19.5",

packages/storybook-builder/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ export const build: WdsBuilder['build'] = async ({ startTime, options }) => {
142142
plugins: [
143143
rollupPluginHTML({
144144
input: { html: await generateIframeHtml(options), name: 'iframe.html' },
145-
// default assets behavior of the plugin breaks, sb-common-assets are shared between manager and preview and copied separately
146-
extractAssets: false,
145+
extractAssets: true,
146+
bundleAssetsFromCss: true,
147+
externalAssets: 'sb-common-assets/**',
147148
}),
148149
rollupPluginNodeResolve(),
149150
rollupPluginPrebundleModules(env),

0 commit comments

Comments
 (0)