Closed spong closed 4 years ago
I had first tried using just the typescript compiler to keep things simple as you said, but was unable to get an ES5 distribution that IE11 would load and so reverted to a babel config I knew would work.
I just gave it another try though and was able to put together a tsconfig that works (PR updated with these changes). That said, using "module": "umd"
results in IE11 erroring out with cannot find module 'react'
. The only module
setting I could get it to work with was "es6"
, so that's the rationale there.
As for naming (the es5 tsconfig & corresponding dist folder), not sure what's best here since you had them based by module type -- thoughts?
Thanks, with those changes this looks great to me. I think web
is a good target name, that's fine.
I've updated the tsconfig name from es5
to web
so that matches too - I'll merge now and release as 1.0.4 imminently. Let me know if you have any other trouble, thanks for contributing! :+1:
Perfect -- thanks so much @pimterry! 🙂 I've updated to 1.0.4
and verified IE11 backwards compatibility + no issue in Chrome/FF/Safari, so all is good! 👍
This PR adds an ES5 distribution (with source map) to
dist/web
and sets thepackage.json
browser field to point to it.This keeps the previous typescript configuration and commonJS/ES Module distributions in tact, and provides a new
build-web
script that uses the Babel CLI to transpile from the ESM source.Running
npm run build
will build all three distributions.