14
5

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 3 years have passed since last update.

Sapperの後継と言われているSvelteKitを試してみるだけ

Posted at

はじめに

10月18日に行われたSvelte Summitで紹介されたSvelteKit。
Sapperの後継者として期待されているとも言われていたので、実際にローカルホストで立ち上げてみたいと思います。
詳しい内容を知りたい方はこちらをご覧ください。
What's the deal with SvelteKit?

新規プロジェクトの作成

まずディレクトリを作成して移動。

mkdir sveltekit-test && cd sveltekit-test

npm init svelte@nextをすることで、SvelteKitの骨組みを用意することができます。

npm init svelte@next
✔ Use TypeScript in components? … yes

SvelteKit-install

Use TypeScript in components?はお好みで

作成が完了すると下記のようなディレクトリ構造になります。

.
├── README.md
├── package.json
├── snowpack.config.js
├── src
│   ├── app.html
│   ├── components
│   │   └── Counter.svelte
│   ├── globals.d.ts
│   └── routes
│       └── index.svelte
├── static
│   ├── favicon.ico
│   └── robots.txt
├── svelte.config.js
└── tsconfig.json

最後にローカルホストを立ち上げて動作を確認できれば完了です。

yarn
npm run dev -- --open

localhost

参考資料

What's the deal with SvelteKit?

宣伝

Qiita Advent Calendar 2020のライブラリ・フレームワーク部門にSvelteを作成致しました。
ご興味のある方は是非参加していただけると嬉しいです。

14
5
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
14
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?