0

I have an NPM package that can be used with the browser. But in order to use it in the browser, I pre-package it using Webpack and put the browserified code in the /dist directory.

Normally, I don't feel it's necessary to include the /dist directory when publishing to NPM, unless someone wants to use the browser version instead of the Node.js version (most of my customers will be using my lib for Node.js not for front-end).

The dist is a huge directory (all the project's code, plus NPM deps) and I want to save people the disk space and install time.

Should I just create a separate package for the browser code, or is there some flag I can use for conditionally including the dist directory when people install my package?

1 Answer 1

1

I believe it's better to create two separate packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.