Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I commit auto generated files published in npm package

I have a NPM package written in TypeScript. My build process takes all *.ts files and bundle them into myLib.d.ts, myLib.js and myLib.js.map.

My NPM package must have all src/.ts files and these three myLib. auto generated files.

But in my git repository, should I commit these three myLib.* auto generated files?

Is it a problem to publish files in npm package that are not under version control?

like image 241
lmcarreiro Avatar asked Nov 01 '25 11:11

lmcarreiro


1 Answers

The output/generated files myLib.d.ts, myLib.js and myLib.js.map shouldn’t managed in git repo.

You should ignore these files by .gitignore. And it won’t effect to publish npm pakeages.

You can also refer the example .gitignore file for TypeScript.

like image 106
Marina Liu Avatar answered Nov 04 '25 02:11

Marina Liu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!