Skip to content

Add support for multiple webpack chunks in iframe#1083

Merged
ndelangen merged 6 commits intomasterfrom
client-chunk-support
Jun 7, 2017
Merged

Add support for multiple webpack chunks in iframe#1083
ndelangen merged 6 commits intomasterfrom
client-chunk-support

Conversation

@ndelangen
Copy link
Copy Markdown
Member

This is a replacement PR for #677

This allows an arbitrary number of files to be loaded into the iframe,
not just the single preview.bundle.js file.

Webpack plugins can output chunks in a separate file. In dev, since
file names are predictable, I can add the js file into a head.html file.
When building storybook statically, however, js files have a hash added
to them, so this doesn't work.

This change makes the static build parse all webpack chunks and load
them in the iframe (excluding the manager script), instead of only
including known files.

This allows an arbitrary number of files to be loaded into the iframe,
not just the single `preview.bundle.js` file.

Webpack plugins can output chunks in a separate file. In dev, since
file names are predictable, I can add the js file into a head.html file.
When building storybook statically, however, js files have a hash added
to them, so this doesn't work.

This change makes the static build parse all webpack chunks and load
them in the iframe (excluding the manager script), instead of only
including known files.
@ndelangen
Copy link
Copy Markdown
Member Author

@apexskier Can you please review and test?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 6, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@bce5716). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1083   +/-   ##
=========================================
  Coverage          ?   13.64%           
=========================================
  Files             ?      207           
  Lines             ?     4640           
  Branches          ?      517           
=========================================
  Hits              ?      633           
  Misses            ?     3555           
  Partials          ?      452
Impacted Files Coverage Δ
app/react/src/server/config/webpack.config.js 0% <ø> (ø)
app/react/src/server/middleware.js 0% <0%> (ø)
app/react/src/server/iframe.html.js 0% <0%> (ø)
app/react/src/server/index.js 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bce5716...207eb44. Read the comment docs.

@ndelangen ndelangen self-assigned this Jun 7, 2017
@ndelangen
Copy link
Copy Markdown
Member Author

  • I've extended the original PR to also work for devmode.
  • The message "storybook started" has been moved till after webpack has compiled.
  • I've added a progress indicator whilst webpack is busy.

Can someone please review?

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Sep 15, 2025

View your CI Pipeline Execution ↗ for commit 207eb44

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-15 14:09:04 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants