Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid Rollup double bundling for pre-bundled static assets for server routes #883

Closed
1 of 5 tasks
thescientist13 opened this issue Feb 10, 2022 · 0 comments · Fixed by #974 or #979
Closed
1 of 5 tasks

avoid Rollup double bundling for pre-bundled static assets for server routes #883

thescientist13 opened this issue Feb 10, 2022 · 0 comments · Fixed by #974 or #979
Labels
alpha.0 CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) SSR v0.27.0
Milestone

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

The current implementation for server rendering routes requires that we run the final HTML on the fly through Rollup at minimum because bundled JS / CSS files will get content hashed, which means that the paths in the templates, e.g.

<script type="module" src="/components/header.js

Get properly turned into something like

<script type="module" src="/components/header.sdf234.js

Details

At its simplest, we could easily add a check to Rollup to check for the existence of a bundled file first and thus avoid the whole emitFile pass, and just rely on HTML updating logic.

The main reason a heavy handed approach was taken because in theory users could additional script tags on the fly in their getTemplate function that may never get statically pre-bundled, so this makes sure that all cases are covered, but perhaps this may not be needed? But maybe there's an even better way to do this?

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) CLI SSR labels Feb 10, 2022
@thescientist13 thescientist13 added this to the 1.0 milestone Feb 10, 2022
@thescientist13 thescientist13 mentioned this issue Sep 22, 2022
27 tasks
@thescientist13 thescientist13 linked a pull request Sep 22, 2022 that will close this issue
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.0 CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) SSR v0.27.0
Projects
None yet
1 participant