Should I git-push a dist folder of a npm package

1.1k views Asked by At

The JS package I've prepared (using tsdx) is being used across multiple company systems. It lies within our gitlab so the package.json entry looks like this:

"some-package": "git+ssh://[email protected]:some-place/some-package.git#some-branch"

Now, every time a user does npm install it takes a large amount of time until the process completes. Is it because of me pushing a src/ folder instead of dist/ (which I do)? Does the package builds itself every time it gets downloaded by npm install? Should I push dist/ folder to shorten the time needed to complete npm install?

2

There are 2 answers

0
MikkelDalby On

Npm install are downloading all your dependencies and placing them I the node_modules folder.

The dist folder is typically for your builded application, so committing and pushing the dist folder wouldn't help on the process time..

0
Kartik K On

No, pushing dist folder is unnecessary as it automatically creates dist folder when npm run start is runned.