Skip to content

Commit

Permalink
docs(install): Clarify & Match tsconfig Edits (shadcn-ui#1642)
Browse files Browse the repository at this point in the history
This is a small update to the installation instructions for some of the frameworks to make the instructions on editing the tsconfig file consistant across the frameworks, and remove some potentially confusing wording (if people read too fast...like me). 

Mainly applying the gatsby tsconfig instructions to vite and astro, as it is the most clear. 
Additionally changed the wording from:
```
 Add the code below to the compilerOptions...
```
to:
```
Add the following code to the compilerOptions...
```
to avoid people easily misreading it as "add the code **below the** compilerOptions".
  • Loading branch information
CamTheGoblin authored Oct 19, 2023
1 parent dcf488c commit 1eb3299
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
10 changes: 7 additions & 3 deletions content/docs/installation/astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ Answer `Yes` to all the question prompted by the CLI when installing Tailwind CS

### Edit tsconfig.json file

Add the code below to the tsconfig.json file to resolve paths:
Add the following code to the `tsconfig.json` file to resolve paths:

```json {2-7} showLineNumbers
```ts {4-9} showLineNumbers
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
"@/*": [
"./src/*"
]
}
// ...
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion content/docs/installation/gatsby.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You will be asked a few questions to configure your project:

### Edit tsconfig.json file

Add the code below to the `tsconfig.json` file to resolve paths:
Add the following code to the `tsconfig.json` file to resolve paths:

```ts {4-9} showLineNumbers
{
Expand Down
26 changes: 17 additions & 9 deletions content/docs/installation/vite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,28 @@ npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```

### Edit tsconfig.json

Add the code below to the compilerOptions of your tsconfig.json so your app can resolve paths without error

```typescript
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
### Edit tsconfig.json file

Add the following code to the `tsconfig.json` file to resolve paths:

```ts {4-9} showLineNumbers
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
```

### Update vite.config.ts

Add the code below to the vite.config.ts so your app can resolve paths without error
Add the following code to the vite.config.ts so your app can resolve paths without error

```bash
# (so you can import "path" without error)
Expand Down

0 comments on commit 1eb3299

Please sign in to comment.