This repository has been archived by the owner on Jan 8, 2018. It is now read-only.
importing capitalize() from ES2015 build of lodash #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Demonstrate how to include ES2015 code in the bundle. Thanks to tree shaking, only the imported
capitalize()
function and the functions it calls (and unfortunately any code that Rollup can't determine whether or not it is needed) is brought into the bundle.The purpose of this is illustrate the tradeoffs involved when bundling vendor code w/ application code. On the one hand, it's included in the single download, and you have direct access to the vendor functions while debugging. On the other hand the bundle is now a bit more cluttered and can be harder to debug.
This works OK, but in this case, b/c we're already concatenating and minifying vendor code into vendor.js, I'm not sure it benefits this application. I'm pretty sure you could get a full custom build of lodash into vendor.js for about the same size (or less since I'm not doing a great job w/ source maps) and number of requests as result from this PR.
There are plenty of opportunities to tweak build configurations (maybe a dev build focused on debugging, or better use of sourcemaps), so I think it's worth merging this experiment as is even though in a real app I'll probably just include (a custom build of?) lodash in vendor.js.