0
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プロジェクト(.tsx、Typescript)を作る方法

Last updated at Posted at 2025-10-21

image.png

掲題の通り、Viteを使ってReactプロジェクトを作成する方法を記載します。

1. Viteのインストール

まず、Viteのプロジェクトを作成するために、npmやyarnを使ってViteのテンプレートを作成します。

1.1 プロジェクトのディレクトリを作成

ターミナルを開いて、以下のコマンドを実行します。

npm create vite@latest <アプリ名> --template react-ts

--template react-tsとは?
ReactとTypeScriptのセットアップをしてくれるViteのテンプレートです。

image.png

使用するフレームワークを選択する

「Select a framework(使用するフレームワークを選んでください)」と表示されるので、「React」を選択します。

使用するVariantを選択する

こちらでは、主にTypescriptもしくはJavascriptを選択する必要があります。
今回は、一番上のTypescriptを選択しましょう。
image.png

Rolldown-Viteを使用するか否かを選択

rolldown-vite は、Rust製の高速なJavaScriptバンドラーであるRolldownViteに統合した実験的なパッケージです。
デフォルトでは、「No」を選択しています。特に理由がなければ「No」のままでよいです。
image.png

パッケージnpmを使うか否か選択

パッケージnpmを使用するかどうかを確認するコマンドです。「Yes」を選択しておきましょう。
image.png

プロジェクトの作成が開始されます。
image.png

下記のように拡張子(.tsx)になりました。
image.png

以上。

サイト

0
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
0
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?