Looking for a way to ignore the JavaScript files compiled from TypeScript in my git repository to make merging, rebasing, and partial commits easier. Here's how I have it set up:
tsconfig.json
{
"compilerOptions": {
"outDir": "./dist"
}
}
.gitignore
dist
During global installation with these commands:
rm -rf dist
node_modules/.bin/tsc
sudo npm install -g
The dist
folder specified in .gitignore
is not installed. Is there a more efficient solution? The following workarounds are not ideal:
- Comment/uncomment the
dist
line in.gitignore
before and after runningsudo npm install -g
- Managing TypeScript and JavaScript files in parallel