slevithan / xregexp

Extended JavaScript regular expressions
http://xregexp.com/
MIT License
3.31k stars 278 forks source link

Use rollup to simplify build/babel/lint #282

Closed jsg2021 closed 2 years ago

jsg2021 commented 4 years ago

supersedes #243, #275. includes #281

This updates all devDependencies to latest (as of now) and removes the need for any babel-runtime dependencies (rollup bakes them in & dedups them for us) This also moves zuul to a npx (on demand) script (since it prints many deprecation warnings atm) The only deprecation warning on install is core-js@2 (which comes from a babel-transform plugin)

Thoughts?

With this change, rollup produces both cjs & umd bundles. npm test passes.

jsg2021 commented 4 years ago

I just noticed #243 ... this maybe a cleaner approach. I made this produce the cjs/umd instead of producing an es module... This makes the original src/ the es code...and the cjs/umd the "fallbacks".

jsg2021 commented 4 years ago

since the umd is nearly ident to the cjs, I could just make the main point to the umd. and stop producing the /lib/index.js... that way there is only one fallback that covers browser & node (cjs).

jsg2021 commented 4 years ago

I've rebased onto your master.

jsg2021 commented 4 years ago

I've updated this to incorporate yesterdays comments from #243 ... I've also fully commented the rollup config.

jsg2021 commented 4 years ago

Squashed & rebased. Hope this is found useful :)

slevithan commented 3 years ago

This sounds good, but I'm not actively supporting XRegExp these days and I'm not very familiar with the details of cjs/umd/esm, rollup, babel, etc., so I'd appreciate insight from @josephfrazier or others.

jsg2021 commented 3 years ago

This should probably be inverted to produce a commonjs & umd build instead of esm & umd... let modern node have the raw sources.