Answer the question
In order to leave comments, you need to log in
What to include in an NPM package, what to leave in a repository?
What to include in an NPM package, what to leave in a repository?
Let's say the library is written in ES2015 + TypeScript and is isomorphic.
I did not find a single approach in a year of observation, so a discussion is proposed:
package
?Answer the question
In order to leave comments, you need to log in
1. Turn on. If the project is in ES6 right away, why should I import ES6 compiled into ES5? And tree-shake won't work...
2. CommonJS. Who needs ES6 modules - see point 1. bundle The consumer of the bundle will do it himself.
3. Tests are a good source of information on the topic "how it should work, and how to call it at all." But you can not include it, but then it's better to write in readme.md, they say, "for more examples, see test/ in the repo."
4. Doesn't make much sense. prepublish solves the "remember to compile before publishing" problem.
5. Why? You will have to copy everything you need to this directory manually or in a prepublish script, extra work.
What prevents you from seeing what the creators of popular NPM packages write in .npmignore?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question