So I have the standard folder structure
dist/
src/
where src
has my .ts files and dist
has my .js files.
(I have "outDir":"dist"
in my tsconfig.json file, and "includes"
set to 'src'
).
Note that 'dist' is in my gitignore
file, so it is not in version control, and so when it goes to Travis or CircleCI
, nothing is in the dist
folder until I run tsc
.
Here is the problem - if I run npm install
first - it will fail because I have this in my package.json:
"bin":{
"foo" :"dist/cli.js" // dist/cli.js does not exist yet
}
but if I run tsc
first - tsc will then be missing dependencies that it needs for compilation, which arrive if I run npm install
.
The only thing I can think of to solve this, is to install all the necessary tsc
dependencies first, then run tsc, then run npm install --production
.
However that is not the most convenient thing to do.
Has anyone run into this problem and found a good solution?