Skip to content

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

License

Notifications You must be signed in to change notification settings

kaelzhang/generator-es-cross

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published