Angular CLI outputs
Exclude dist/, coverage/ and environment files safely.
Explore resourceProfessional .gitignore tools
Perfect .gitignore template for Angular projects. Covers Angular CLI, Nx workspace, and all Angular project types. Ignore node_modules, dist/, and Angular cache properly.
# Angular .gitignore Template - Updated 2025 # Dependencies node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* # Angular compiled output dist/ tmp/ out-tsc/ bazel-out/ # Angular cache .angular/ .sass-cache/ # IDEs and editors .idea/ .project .classpath .c9/ *.launch .settings/ *.sublime-workspace .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json .history/* # OS specific files .DS_Store Thumbs.db # Angular profiling files chrome-profiler-events*.json # Node npm-debug.log yarn-error.log # Runtime data pids *.pid *.seed *.pid.lock # Coverage directory used by tools like istanbul coverage/ *.lcov .nyc_output/ # ESLint cache .eslintcache # Optional npm cache directory .npm # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # Environment variables .env .env.local .env.development.local .env.test.local .env.production.local # Firebase .firebase/ firebase-debug.log # E2E test reports e2e-results/ # Cypress cypress/videos/ cypress/screenshots/ cypress/downloads/ # Protractor e2e/*.js e2e/*.map # System Files .DS_Store Thumbs.db # Angular Universal # Server rendered app (Angular Universal) ssr/ # Angular CLI cache .angular/cache/ # Webpack bundle analyzer stats.json # TypeScript cache *.tsbuildinfo # Optional stylelint cache .stylelintcache # Storybook build outputs storybook-static/ # Temporary folders tmp/ temp/ # Log files logs/ *.log # Dependency directories jspm_packages/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn v2 .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz .pnp.* # Nx .nx/cache .nx/workspace-data # Angular DevKit .angular-devkit/
dist/ - Build output.angular/ - Angular cacheout-tsc/ - TypeScript compiled outputbazel-out/ - Bazel build outputstmp/ - Temporary filescoverage/ - Test coveragee2e-results/ - E2E test resultscypress/videos/ - Cypress recordingscypress/screenshots/ - Test screenshots*.spec.js - Compiled test files# Additional for Nx .nx/cache .nx/workspace-data dist/ tmp/ # Nx cloud cache .nxcache/
# Additional for Universal ssr/ dist-server/ prerender/ # Server build server.js
# Additional for Ionic platforms/ plugins/ www/ # Capacitor ios/ android/
# Additional for Elements elements/ custom-elements/ # Bundled elements *.ngfactory.js *.ngstyle.js
The .angular/ directory contains Angular CLI's cache files. This significantly speeds up builds but should never be committed.
Make sure your build output is properly ignored:
# Remove already tracked dist folder git rm -r --cached dist/ # Add to .gitignore echo "dist/" >> .gitignore # Clean Angular cache if needed ng cache clean
Clean Angular cache and ensure it's ignored:
# Clean Angular cache ng cache clean # Or manually remove rm -rf .angular/ # Verify .angular/ is in .gitignore
E2E test outputs should be ignored. Add patterns for your testing framework:
cypress/videos/, cypress/screenshots/e2e/*.js, e2e/*.maptest-results/, playwright-report/No! The angular.json file is crucial for your Angular project configuration. It defines build configurations, project structure, and CLI commands. Always commit this file.
Always ignore compiled TypeScript files (*.js, *.js.map) in your src/ directory, but keep configuration files like karma.conf.js. The out-tsc/ and dist/ directories should be completely ignored.
No, always commit package-lock.json. Angular projects have many dependencies and exact versions are crucial for consistent builds across team members and CI/CD environments.
Yes, always ignore the .angular/ directory. It contains Angular CLI's cache files that are machine-specific and can be several hundred MB in size. They're rebuilt automatically when needed.
Exclude dist/, coverage/ and environment files safely.
Explore resourceAvoid pipeline cache conflicts with proper ignore rules.
Explore resourceShare common ignore patterns across Angular libraries.
Explore resourceGrab the curated template and share it with teammates.