Reputation: 8726
If I have created an npm package (hosted on internal npm repo), do I need to transpile the source code, or can I just copy the source code?
The consumers of the npm package are internal front end applications within the same company that created the npm package. They are browser front end applications. Each with their own modern Webpack build processes. The consumers are able to read and build the source code from the npm package. There are no other consumers.
It leads me to wonder, if consumers each have their own build process, and those processes are fully compatible with the npm package's source code, does the npm package even need to even transpile anything? I am scratching my head wondering why the answer to this question isn't coming to me so obviously.
And if I can just include the source as my distribution, the next question is why would I want to do anything to the source before copying it into my build distribution, considering who will consume the package?
Upvotes: 4
Views: 257
Reputation: 948
The presence of a dist is just a natural occurrence of the usual structure of a transpiled module. It demonstrates that it did build successfully, and people could choose to test just that single module before integrating with their larger project. So, conceptually/technically not required in your scenario but a "usual" and a nicety.
Upvotes: 2