SharePoint Framework 用 .gitignore
SharePoint Framework 用の除外ルール 17 件。そのままリポジトリにコピーして使えます。
SharePoint のページおよび Web パーツ モデル
SharePoint Framework 用 .gitignore の完全版
# LFGitignore によって生成 - https://lfgitignore.com
# 作成日:2026-10-31 23:47:04 UTC
# 技術:SharePoint Framework
### SharePoint Framework ###
node_modules
dist
logs
lib
solution
temp
*.sppkg
# macOS フォルダー設定 (デスクトップ サービス ストア)
.DS_Store
.ntvs_analysis.dat
# ログファイル
*.log
.vs
# カバレッジデータ用ディレクトリ
coverage
bin
# npmデバッグログ
npm-debug.log*
obj
*.resx.ts
*.scss.ts
SharePoint Framework のルールで除外されるもの
以下の各パターンと、.gitignore に含める理由を説明します。
依存関係ディレクトリ
| パターン |
除外対象 |
node_modules |
依存関係ディレクトリ |
ビルド時に生成されるファイル
| パターン |
除外対象 |
dist |
ビルド時に生成されるファイル |
lib |
ビルド時に生成されるファイル |
solution |
ビルド時に生成されるファイル |
temp |
ビルド時に生成されるファイル |
*.sppkg |
ビルド時に生成されるファイル |
ログ
| パターン |
除外対象 |
logs |
ログ |
*.log |
ログファイル |
npm-debug.log* |
npmデバッグログ |
OSX
| パターン |
除外対象 |
.DS_Store |
macOS フォルダー設定 (デスクトップ サービス ストア) |
Visual Studio ファイル
| パターン |
除外対象 |
.ntvs_analysis.dat |
Visual Studio ファイル |
.vs |
Visual Studio ファイル |
bin |
Visual Studio ファイル |
obj |
Visual Studio ファイル |
istanbul などのツールで使用されるカバレッジ ディレクトリ
| パターン |
除外対象 |
coverage |
カバレッジデータ用ディレクトリ |
Resx で生成されたコード
| パターン |
除外対象 |
*.resx.ts |
Resx で生成されたコード |
スタイル生成コード
| パターン |
除外対象 |
*.scss.ts |
スタイル生成コード |
この SharePoint Framework 用 .gitignore の使い方
- 上の SharePoint Framework 用ルールをコピーするか、ファイルを直接ダウンロードしてください。
- Git リポジトリのルートに .gitignore という名前のファイルを作り、ルールを貼り付けます。
- 対象のファイルがすでに追跡されている場合は、git rm -r --cached . を実行して再度コミットしてください。Git の除外ルールは未追跡のファイルにのみ適用されます。
- チーム全員で同じルールを共有できるよう、.gitignore をコミットします。