1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ViteでReactプロジェクト(例:npm create vite@latest)を新規作成した際のデータ構成

Posted at

📁 Vite(React)の初期構成と削除してよいファイル一覧

ViteでReactプロジェクト(例:npm create vite@latest )を作成すると、以下のような構成になります。


✅ デフォルトのディレクトリ構成

my-blog/
├── node_modules/         # npmパッケージの依存フォルダ(触らない)
├── public/               # 静的ファイルを置く場所
│   └── vite.svg          # 初期ロゴ。不要なら削除可
├── src/                  # ソースコード
│   ├── assets/           # 画像などのアセット(vite.svgが入ってる)
│   ├── App.css           # App用のスタイル
│   ├── App.jsx           # メインのReactコンポーネント
│   ├── index.css         # グローバルCSS
│   └── main.jsx          # アプリのエントリーポイント
├── .gitignore            # Git管理で無視するファイルの指定
├── index.html            # HTMLのテンプレート
├── package.json          # プロジェクトの設定・依存関係
├── vite.config.js        # Viteの設定
└── README.md             # プロジェクト説明(不要なら削除可)

🧹 削除しても大丈夫なファイル

ファイル/フォルダ 削除OK 理由
src/assets/vite.svg Viteのロゴ画像。使わなければ不要。
src/App.css 独自にCSSを書く場合は不要。
src/index.css グローバルCSSを別で用意するなら不要。
public/vite.svg 使用しないなら削除OK。
README.md GitHubに上げないなら不要。
App.jsx の初期表示部分 ロゴなど初期表示は自由に変更可能。

🛑 削除しない方がよいファイル

ファイル/フォルダ 理由
src/main.jsx Reactアプリの起点。必須。
index.html HTMLのエントリーポイント。
package.json npmスクリプトや依存関係を管理。
vite.config.js プロジェクト設定。プラグイン追加時に使う。

✍️ 最小構成で始めたいとき

以下のようにシンプルな構成にするのもおすすめです:

src/
├── App.jsx
└── main.jsx
  • App.jsx:自作のReactコンポーネント
  • main.jsx:ReactDOMでAppを表示するだけ

💬 補足

  • 名前や用途に応じて構成は自由に変更してOK。
  • 例えばブログの場合は /src/pages//src/components/ のように分けても便利。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?