-
Notifications
You must be signed in to change notification settings - Fork 360
Fix problem #960
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 problem #960
Conversation
1. The nameCache obtained in writebundle hook is not a reference to terseroptions 2. JSON.stringify(nameCache) requires converting regex to a string first.
🦋 Changeset detectedLatest commit: b0f2291 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Would you mind splitting half of this out into another PR? Fixing two (seemingly) different issues in one PR makes it a bit hard to review and follow.
Edit: Also helps the history. With both fixes in one PR, it's a bit murky which bit of code fixes what issue. If there's ever problems, it helps if it's clear to what issue a line was altered/added.
For both, do you mind writing up issues showcasing the problems you're experiencing?
css compilation problems when multiple entries
This is a bit vague, for example. It's difficult to review the work because I don't know what issues you've run into or if your added test cases adequately check your fix.
Thanks
zyrong
commented
May 16, 2022
Would you mind splitting half of this out into another PR? Fixing two (seemingly) different issues in one PR makes it a bit hard to review and follow.
Edit: Also helps the history. With both fixes in one PR, it's a bit murky which bit of code fixes what issue. If there's ever problems, it helps if it's clear to what issue a line was altered/added.
For both, do you mind writing up issues showcasing the problems you're experiencing?
css compilation problems when multiple entries
This is a bit vague, for example. It's difficult to review the work because I don't know what issues you've run into or if your added test cases adequately check your fix.
Thanks
What should I do to split into two pr
-
This commit fixes that when different entries reference different CSS, only the related CSS of the first entry will be packaged. For specific changes, please see this commit. I also added the corresponding test case
fix: css compilation problems when multiple entries -
This commit fixes the problems related to terser namecache. When terser compresses the code, the damaged variable names will be written to the namecache. Finally, the namecache will be written to the file system in this code, but after my test, it doesn't seem to work here
fix: Fix problems related to use rollup-plugin-terser
rschristian
commented
May 16, 2022
What should I do to split into two pr
CSS fixes in one, Terser thing in another. Specific commits get lost as PRs are squashed and merged.
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.
This shouldn't be a patch if file names are changing without any user behavior alterations.
In spirit of keeping naming consistent, CSS output should also match every other file output by default, not fallback to index IMO.
Can we revert this bit, or switch this to a minor please?
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.
Did these mangle files need to be updated in order to ensure tests still pass? If so, this too is a breaking change and the changeset should be corrected to mark this as a minor (Semver 0-major, breaking change = minor bump).
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.
This is incorrect. Please use the existing naming setup that we had, it ensures names are properly stripped:
Line 505 in 9a4e2b2
index.esm.js as an input needs to become index; yours would have it become index.esm, so index.esm.css would be output. We need to strip indicators towards ES module format, i.e., cjs, es[m], etc.
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.
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.
How about changing it to this
zyrong
commented
Jun 3, 2022
What should I do to split into two pr
CSS fixes in one, Terser thing in another. Specific commits get lost as PRs are squashed and merged.
I have split it into two independent PRs and modified them. Can you make some suggestions or reply to the changes
fix: css compilation problems when multiple entries
fix: Fix problems related to use rollup-plugin-terser