.gitignore for SharePoint Framework
17 ignore rules for SharePoint Framework, ready to copy into your repository.
Page and web part model for SharePoint
The complete .gitignore for SharePoint Framework
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:29:18 UTC
# Technologies: SharePoint Framework
### SharePoint Framework ###
node_modules
dist
logs
lib
solution
temp
*.sppkg
# macOS folder settings (Desktop Services Store)
.DS_Store
.ntvs_analysis.dat
# Log file
*.log
.vs
# Coverage directory
coverage
bin
# npm debug logs
npm-debug.log*
obj
*.resx.ts
*.scss.ts
What these SharePoint Framework rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Dependency directories
| Pattern | What it ignores |
|---|---|
node_modules |
Dependency directories |
Build generated files
| Pattern | What it ignores |
|---|---|
dist |
Build generated files |
lib |
Build generated files |
solution |
Build generated files |
temp |
Build generated files |
*.sppkg |
Build generated files |
Logs
| Pattern | What it ignores |
|---|---|
logs |
Logs |
*.log |
Log file |
npm-debug.log* |
npm debug logs |
OSX
| Pattern | What it ignores |
|---|---|
.DS_Store |
macOS folder settings (Desktop Services Store) |
Visual Studio files
| Pattern | What it ignores |
|---|---|
.ntvs_analysis.dat |
Visual Studio files |
.vs |
Visual Studio files |
bin |
Visual Studio files |
obj |
Visual Studio files |
Coverage directory used by tools like istanbul
| Pattern | What it ignores |
|---|---|
coverage |
Coverage directory |
Resx Generated Code
| Pattern | What it ignores |
|---|---|
*.resx.ts |
Resx Generated Code |
Styles Generated Code
| Pattern | What it ignores |
|---|---|
*.scss.ts |
Styles Generated Code |
How to use this .gitignore for SharePoint Framework
- Copy the SharePoint Framework rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.