Tuesday 22 March 2016

What's the best way to publish private NPM ES6 packages?

What's the best way to publish NPM packages written in ES6? The easiest way would be to publish as ES5 but some of our NPM packages will be used for client-side code so adding transpiler bloat is not ideal.Also we would still be using paths inside the modules, regardless if we would be using it from Node or Webpack, such asrequire('@scope/my-module/internal/file.js') I had some ideas such as, using ES6 as the "default" exposed scripts, but would monkey-path Node's requirefunction to append /es5 to the path so that the ES5 files can be used.Any ideas?

Submitted March 22, 2016 at 07:52PM by dscer

No comments:

Post a Comment