Skip to content

Commit 2fcb405

Browse files
committed
feat(storybook-builder): extract and bundle preview assets
1 parent 2f04ee7 commit 2fcb405

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
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

+1-1
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.2.1",
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+
// TODO: need to filter out sb-common-assets, e.g. if this is supported https://github.com/modernweb-dev/web/pull/2671
146+
extractAssets: true,
147+
bundleAssetsFromCss: true,
147148
}),
148149
rollupPluginNodeResolve(),
149150
rollupPluginPrebundleModules(env),

0 commit comments

Comments
 (0)