test-es6-module-with-commonjs

0.1.7 • Public • Published

ESM Package (with Hybrid CommonJS support)

Concept for publishing an NPM ESM package (with CommonJS backward):

  • 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)

Links

Note

  • script transpile:js is probably useless (but in case we need to provide a minimify version ?)

Readme

Keywords

none

Package Sidebar

Install

npm i test-es6-module-with-commonjs

Weekly Downloads

3

Version

0.1.7

License

none

Unpacked Size

2.41 kB

Total Files

6

Last publish

Collaborators

  • arthurgerbelot