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?

More than 1 year has passed since last update.

svelte + typescript 開発環境をコマンド1発で爆速構築 (Vite)

Last updated at Posted at 2022-04-17

結論

npm init vite@latestを実行し、プロジェクト名入力と選択をするだけです。
(Viteを事前にインストールする必要もないはず)

$ npm init vite@latest
✔ Project name: … svelte-test // プロジェクト名入力
✔ Select a framework: › svelte // svelteを選択
✔ Select a variant: › svelte-ts // typescriptを選択

Scaffolding project in /Users/apple/svelte-test...

Done. Now run:

  cd svelte-test
  npm install
  npm run dev

あとは書かれているコマンドを実行するだけです。

  cd svelte-test
  npm install
  npm run dev

http://localhost:3000 にアクセス

Svelte___TS___Vite_App.png

感想

合計コマンド4発でしたごめんなさい。

ホットリロードもとても早いので最高です。

参考

この記事ではtailwindも導入しています。
https://www.section.io/engineering-education/svelte-with-vite-typescript-and-tailwind-css/

prettier導入

pretiierを入れたい場合は、こちらも実行しましょう。

npm i -D prettier-plugin-svelte prettier

[参考]
https://zenn.dev/miruoon_892/articles/f5e56b7fcc0702b4aef2

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?