Skip to content

Commit

Permalink
feat(storybook-builder): bundle preview assets
Browse files Browse the repository at this point in the history
  • Loading branch information
bashmish committed Mar 19, 2024
1 parent e611720 commit f29dbce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-sloths-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/storybook-builder': patch
---

bundle preview assets
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/storybook-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@web/dev-server": "^0.4.0",
"@web/dev-server-core": "^0.7.0",
"@web/dev-server-rollup": "^0.6.1",
"@web/rollup-plugin-html": "^2.1.2",
"@web/rollup-plugin-html": "^2.3.0",
"browser-assert": "^1.2.1",
"es-module-lexer": "^1.2.1",
"esbuild": "^0.19.5",
Expand Down
5 changes: 3 additions & 2 deletions packages/storybook-builder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ export const build: WdsBuilder['build'] = async ({ startTime, options }) => {
plugins: [
rollupPluginHTML({
input: { html: await generateIframeHtml(options), name: 'iframe.html' },
// default assets behavior of the plugin breaks, sb-common-assets are shared between manager and preview and copied separately
extractAssets: false,
extractAssets: true,
bundleAssetsFromCss: true,
externalAssets: 'sb-common-assets/**',
}),
rollupPluginNodeResolve(),
rollupPluginPrebundleModules(env),
Expand Down

0 comments on commit f29dbce

Please sign in to comment.