1.0.5 • Published 5 years ago

generator-es-cross v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Build Status

generator-es-cross

Yeoman generator to create a nodejs library to support both esm and commonjs by using package.main and package.module

Install

$ npm i -g generator-es-cross

Usage

# It is recommanded to clone the empty repo first,
# because `generator-es-cross` reads the git remote url
#   and set default prompts values.
git clone git@github.com:my-name/my-empty-repo.git

cd my-empty-repo

yo es-cross

After that

  • ES module files will be located at ./src
  • ES modules will be transformed into commonjs to directory ./lib which is ignored by git.
  • package.main -> ./lib
  • package.module -> ./src
  • both directory src and directory lib will be included in NPM tarball.

License

MIT