Get a new SvelteKit project started with the CLI.
Start here:
pnpm create svelte building-with-sveltekit-and-graphql
# or with npm
npm init svelte building-with-sveltekit-and-graphql
From the CLI pick the following options:
✔ Which Svelte app template? › Skeleton project
✔ Add type checking with TypeScript? › Yes, using JavaScript with JSDoc comments
✔ Add ESLint for code linting? … Yes
✔ Add Prettier for code formatting? … Yes
✔ Add Playwright for browser testing? … Yes
Or chose what you like 😊 just be aware that the workshop will be using the options mentioned here.
Once the project has been created follow the rest of the CLI instructions here’s the output:
Your project is ready!
✔ Type-checked JavaScript
<https://www.typescriptlang.org/tsconfig#checkJs>
✔ ESLint
<https://github.com/sveltejs/eslint-plugin-svelte3>
✔ Prettier
<https://prettier.io/docs/en/options.html>
<https://github.com/sveltejs/prettier-plugin-svelte#options>
✔ Playwright
<https://playwright.dev>
Install community-maintained integrations:
<https://github.com/svelte-add/svelte-adders>
Next steps:
1: cd building-with-sveltekit-and-graphql
2: npm install (or pnpm install, etc)
3: git init && git add -A && git commit -m "Initial commit" (optional)
4: npm run dev -- --open
To close the dev server, hit Ctrl-C
Stuck? Visit us at <https://svelte.dev/chat>
Take note of the Install community-maintained integrations link! That will come in handy later...
Here’s the commands:
# change directory into the project
cd building-with-sveltekit-and-graphql
# install dependencies
pnpm install # or npm or yarn whicever you prefer
# initial git commit
git init && git add -A && git commit -m "Initial commit"
# run the dev server
pnpm run dev --open
The final command npm run dev --open
will open a browser tab in your default browser showing the SvelteKit skeleton project.
The SvelteKit skeleton project index (home) page