Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  5] [ 3]  / answers: 1 / hits: 45624  / 9 Years ago, mon, april 20, 2015, 12:00:00

I was about to publish a module to NPM, when I thought about rewriting it in ES6, to both future-proof it, and learn ES6. I've used Babel to transpile to ES5, and run tests. But I'm not sure how to proceed:




  1. Do I transpile, and publish the resulting /out folder to NPM?

  2. Do I include the result folder in my Github repo?

  3. Or do I maintain 2 repos, one with the ES6 code + gulp script for Github, and one with the transpiled results + tests for NPM?



In short: what steps do I need to take to publish a module written in ES6 to NPM, while still allowing people to browse/fork the original code?


More From » node.js

 Answers
1

The pattern I have seen so far is to keep the es6 files in a src directory and build your stuff in npm's prepublish to the lib directory.



You will need an .npmignore file, similar to .gitignore but ignoring src instead of lib.


[#67008] Friday, April 17, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
beatrices

Total Points: 745
Total Questions: 103
Total Answers: 105

Location: Guam
Member since Tue, Nov 29, 2022
2 Years ago
;