Use microbundle instead of Webpack #312
Merged
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.
This PR replaces Webpack with microbundle, which uses Rollup under the hood. Microbundle is faster, the output is smaller, and there's way less to install and configure.
I also tweaked the outputs/targets:
route.js
is the default (main
,umd:main
,unpkg
, andbrowser
), it's a UMD build that should work basically everywhereroute.m.js
is an ES module (module
)route.es.js
is an ES module specifically targeting modern browsers, so it's a bit smaller and faster thanroute.m.js
route.js
should just work, bundlers or packages likeesm
can be used to importroute.m.js
if necessary, and Ziggy's target environment is the browser anywayAll tests pass on all of these builds, but I'll keep playing around with this in real apps and in the browser before it's merged.
See also Writing a small module in 2018