Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Summary

In this example, we will create a project from scratch using _deGit_
In this example we will create a project from scratch using _vite_
and then add support for _TypeScript_

# Step By Step Guide

First let's create our project, we will call it "example-app",
First let's create our project, we will call it "example-app":

```bash
npm init vite
```

Let's let install the vite tooling then you will go through a guided process:
Let's let the vite tooling install then you will go through a guided process:

- First choose the right project name, e.g. "example-app"

- Then choose the framework, in this case _svelte_ and as a variant
_svelte-ts_

A folder has been created (e.g. "example-app"), now you can
A folder has been created (e.g. "example-app"), now you can:

```bash
cd example-app
Expand All @@ -35,8 +35,8 @@ npm run dev
- Just one more thing to wrap up this example, to enhance your development
experience, I encourage you to install the following VS Code plugins:

- Svelte for Vs Code
- Svelte Intellisense
- [Svelte for Vs Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode)
- [Svelte Intellisense](https://marketplace.visualstudio.com/items?itemName=ardenivanov.svelte-intellisense)

- And if you use prettier is a good idea to install an additional package
Copy link
Member Author

@crsanti crsanti Sep 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't need this plugin in order to be able to format the code, just opening VSCode inside that project and enabling Svelte for VSCode 's TypeScript plugin was enough. Alternatively you can add a default formatter and use svelte.svelte-vscode that will use Prettier under the hood. Prettier extension can't handle .svelte filetypes by itself.

On the other hand it was required for me to open the project folder in VSCode (not as subfolder) in order to have correct import definitions, otherwise I get errors like these:

Cannot find module './assets/svelte.svg' or its corresponding type declarations.ts(2307)

to get a good prettier integration when formatting code:
Expand Down
14 changes: 7 additions & 7 deletions 00-boiler-typescript/example-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 00-boiler-typescript/example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@sveltejs/vite-plugin-svelte": "^1.0.1",
"@tsconfig/svelte": "^3.0.0",
"prettier-plugin-svelte": "^2.7.0",
"svelte": "^3.49.0",
"svelte": "^3.50.1",
"svelte-check": "^2.8.0",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
Expand Down