-
Notifications
You must be signed in to change notification settings - Fork 660
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
Bundle helmet using rollup #395
Conversation
The test failure is unrelated to this change. Fix in #397. |
@realityking Thank you for this PR, this one makes sense to me. I'll review and get back to you early next week. Sorry for the delay, I'm going to be jumping in for Chris. |
@realityking quick update. I talked with @cwelch5 over the weekend and we are both like the idea of moving to rollup. The plan is to test internally, bumping a major version, then npm publishing a beta version for feedback. It's going to take a little bit to get all this formalized, but we are making good progress. |
Great to see helmet coming back to life :) I've rebased on top of master and updated all the rollup related dependencies. |
@realityking doesn't look like travis / node v4 likes the latest branch. Let me find out if node 4, is still a requirement, or if we can take it out of the build step. |
According to this link, https://github.com/nodejs/Release, 4 is EOL. We should remove it from the travis build checks. |
Codecov Report
@@ Coverage Diff @@
## master #395 +/- ##
======================================
Coverage 97.6% 97.6%
======================================
Files 3 3
Lines 292 292
======================================
Hits 285 285
Misses 7 7
Continue to review full report at Codecov.
|
This PR adds rollup to bundle helmet into a single module for CJS and ESM.
The main advantage is smaller code size (about 8% for the CommonJS version) due to inlined exports and deduplicated babel helpers. It will also improve start up time a little bit when bundling the CommonJS version with Webpack, as it creates a function invocation for every module.
Lastly, this help minifies and optimisers more easily see the code paths taken and allow them to drop/inline more things when bundling.
Note that this will be braking change: