fix: nitroV2Plugin compress public assets by default#2112
Conversation
🦋 Changeset detectedLatest commit: 9c6406b 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 |
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
fixes solidjs#2096 - match `1.x` behavior for easier migration; can still be overridden to false for users who prefer uncompressed files. - extract common build test utilities. - fix tree shaking tests that were using unreliable regex (didn't account for minification and variable renaming); replace with a unique string identifier for better resilience, and add a complementary test for the tree shaking with side effects case. - add vitest `~` alias configuration, as the solid plugin wasn't resolving it in the test environment.
b466fac to
0a4b697
Compare
themavik
left a comment
There was a problem hiding this comment.
Reviewed the changes — the implementation looks correct and addresses the issue well.
themavik
left a comment
There was a problem hiding this comment.
What this PR does: Enables compression of public assets by default in nitroV2Plugin, matching 1.x behavior, and refactors build output test utilities.
Done well: The build-output-utils extraction reduces duplication across server-secret-leak and treeshake tests. The treeshaking tests now handle .gz and .br variants via readFileContent. The compressed-public-assets test verifies the feature. Using unique strings (myTreeshakingTestUniqueString1/2) avoids false positives.
Note: The (no-side-effects) and side-effects route changes from numeric to string markers—ensure this does not affect other tests or build behavior. The regex in getFiles for .js(.gz|.br)? is a good pattern for compressed output.
|
@yinonburgansky Thank you for the fix 🙂🙏 |
PR Checklist
Please check if your PR fulfills the following requirements:
Changes
1.xbehavior for easier migration; can still be overridden to false for users who prefer uncompressed files.~alias configuration, as the solid plugin wasn't resolving it in the test environment.