Text NPM package ESModule implementing CommonJS dual export
npm install test-es6-module-with-commonjs - Create an ESModule package (in ./src) {type:"module"}
- On publish use Babel to transpile (in ./lib)
-> Also add {"type":"commonjs"} on ./lib/package.json file.
- use ./node_modules/.bin on script to avoid using global on another environment.
- Store only ./src on dit (./lib and ./node_modules are useless)
- Before Publishing, transpile the package (Root-Project's Babel who'll use commonjs version of this package will not bundle dependencies)
- Add link about Doc/Design/ESM
- Hybrid ESM/CommonJS Packages
- StackOverflow - How to publish a module written in ES6 to NPM?
- script transpile:js is probably useless (but in case we need to provide a minimify version ?)