I have been using git to distribute an internal TypeScript NPM package. To avoid cluttering my repository with build files, I have implemented a postinstall action to build the package upon installation:
"postinstall": "tsc -p tsconfig.json"
In order to successfully build the package, certain dependencies (such as TypeScript) are necessary. However, including them as dev dependencies means they are not accessible during the postinstall phase, forcing me to declare them as regular dependencies.
My queries regarding this setup are:
- Are there any disadvantages to specifying these build dependencies as regular dependencies in my package.json file?
- If so, what is the recommended method for designating build-only dependencies in NPM packages installed via git?