/random-number-generator

A test npm module to experiment with different styles (esm, amd ...)

Primary LanguageJavaScript

Example project to publish npm module in different styles

write es5, 'build' es5

In v0.0.1 there was no build involved, I simply used node.js's

  • require
  • module.exports

to generate a es5 compatible module, that then could get required in any consuming project.

write es6, build es5

In v0.0.2 I introduced babel to generate a module, that could be written in es6 (using import) and processed to es5.

This module could be imported and required (but using require('moduleName').default) either way in a consuming project.

Open issues

  • babel setup uses the old babel-preset-env and being configured via .babelrc - I wanted to build it via @babel/preset-env but babel.config.json was not doing anything šŸ¤·