-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
fix(html): Template files should only include entry chunks #688
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! You're on the right path, but just off of it. I think the idea is good for default behavior as well, and while it is breaking, it'll make default behavior for others easier to understand when the build gets a little bigger. So good call. Where you want to make the change though, is here: plugins/packages/html/src/index.ts Lines 41 to 46 in a54d2a1
|
@shellscape Sounds good- actually, I looked at that approach too but went the other direction because I thought the behavior change was a mistake in a1b2fc3. I'll update this PR 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate that you're trying to make this easier for the use case on your end, but I don't think you're considering the flexibility needed for the userbase as a whole. I'd like the original getFiles to be reinstated, and the block I mentioned here #688 (comment) to filter for entry files like you had originally intended. That allows any custom template or consumer to get the full stack of build files as originally intended.
Wait, doesn't removing the filter from About the filter itself, I am using some assumptions about Rollup's (file) =>
file.type === 'chunk' ||
(typeof file.type === 'string' ? file.type === 'asset' : file.isAsset) But maybe I am missing something- is that assumption invalid? Let me know, I am ready to tweak the PR as needed, just need more clarification... |
486cc69
to
34ba4ce
Compare
bf34a3b
to
77e6a8e
Compare
b353836
to
3038271
Compare
a69c299
to
a9b9cd3
Compare
Rollup Plugin Name:
html
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers: #634
Description
I ran into a regression in #634 where non-entry scripts are injected into the default html template. This can cause unexpected behavior especially if those scripts have side-effects. This PR fixes the file filter and also adds a guard in case rollup emitted any javascript asset files.