I want to build a private library for my organisation and install it by git url. I also want to build this library using Typescript.
The common way to use Typescript for NPM-published libraries is to add the folders that will contain compiled Javascript files to .gitignore
, and then to run npm publish
before publishing it to NPM registry. This way, library users will download a package that contains git-tracked source files as well as compiled Javascript and type definition files.
However, if I install this library using git, I will not be able to install files other than tracked by git. I don't want to track the compiled files by git, because it goes against the basic principle of version control: track only source files and ignore all automatically generated artefacts.
What's the common approach to structure and set up build scripts for the library in this case?