I am using git to distribute an internal TypeScript NPM package. As I don't want to have build files in my repository, I am using a postinstall action to build the package when it is installed:
"postinstall": "tsc -p tsconfig.json"
To build my package, some dependencies (e.g. TypeScript) are required. However, when I add them as dev dependencies, they are not available in the postinstall phase, so I have to add them as regular dependencies.
So my questions are:
- Are there any drawbacks from having these build dependencies declared as regular dependencies in my package.json?
- If so, what would be the preferred way to express build-only dependencies in NPM packages that are installed via git?