Esnext esm rollup, optionally w/o EventTargetShim #107
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.
Split cjs,esm plugin rollup config. For esm, override tsconfig target compiler option with esnext. For both, replace EventTargetShim d.ts import with DOM EventTarget in the generateBundle hook. Move event-target-shim back to build dependencies.
If EVTSHIM=0 rollup, use native EventTarget only without importing event-target-shim or inlining it in the js. Dummy EventTarget=Object if undefined, so that serverside import doesn't crash (I split fetch and render, not using events there). This results in 30% smaller file, winning TTI milliseconds on embedded devices where I build engines from source and so know they're modern enough.
Size of esm is 184k before (commit 003d2c2), 152k after, 92k with EVTSHIM=0. Resolves #65. Please build and try this in some real-world app copy before merging, because my app is still Preact-based, I only ran this against the few hundred lines of small components I could port to Crank quickly.