Skip to content

Commit 620bb7d

Browse files
authored
Fix Vite config mentions in docs (#1509)
1 parent b957e9a commit 620bb7d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

web/docs/project/custom-vite-config.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ title: Custom Vite Config
44

55
import { ShowForTs, ShowForJs } from '@site/src/components/TsJsHelpers'
66

7-
Wasp uses [Vite](https://vitejs.dev/) for serving the client during development and bundling it for production. If you want to customize the Vite config, you can do that by creating a `vite.config.js` or `vite.config.ts` file in your `src/client` directory.
7+
Wasp uses [Vite](https://vitejs.dev/) for serving the client during development and bundling it for production. If you want to customize the Vite config, you can do that by editing the `vite.config.ts` file in your `src/client` directory.
88

9-
Wasp will use your config and **merge** it with the default Wasp's Vite config.
9+
Wasp will use your config and **merge** it with the default Wasp's Vite config.
1010

1111
Vite config customization can be useful for things like:
12+
1213
- Adding custom Vite plugins.
1314
- Customising the dev server.
1415
- Customising the build process.
@@ -33,6 +34,7 @@ export default {
3334
},
3435
}
3536
```
37+
3638
</TabItem>
3739
<TabItem value="ts" label="TypeScript">
3840

@@ -45,6 +47,7 @@ export default defineConfig({
4547
},
4648
})
4749
```
50+
4851
</TabItem>
4952
</Tabs>
5053

@@ -58,31 +61,32 @@ You have access to all of the [Vite dev server options](https://vitejs.dev/confi
5861
```js title="src/client/vite.config.js"
5962
export default {
6063
server: {
61-
port: 4000
64+
port: 4000,
6265
},
6366
}
6467
```
6568

6669
```env title=".env.server"
6770
WASP_WEB_CLIENT_URL=http://localhost:4000
6871
```
72+
6973
</TabItem>
7074
<TabItem value="ts" label="TypeScript">
7175

72-
7376
```ts title="src/client/vite.config.ts"
7477
import { defineConfig } from 'vite'
7578

7679
export default defineConfig({
7780
server: {
78-
port: 4000
81+
port: 4000,
7982
},
8083
})
8184
```
8285

8386
```env title=".env.server"
8487
WASP_WEB_CLIENT_URL=http://localhost:4000
8588
```
89+
8690
</TabItem>
8791
</Tabs>
8892

@@ -92,7 +96,7 @@ WASP_WEB_CLIENT_URL=http://localhost:4000
9296

9397
### Customising the Base Path
9498

95-
If you, for example, want to serve the client from a different path than `/`, you can do that by customizing the `base` option.
99+
If you, for example, want to serve the client from a different path than `/`, you can do that by customizing the `base` option.
96100

97101
<Tabs groupId="js-ts">
98102
<TabItem value="js" label="JavaScript">
@@ -102,16 +106,17 @@ export default {
102106
base: '/my-app/',
103107
}
104108
```
109+
105110
</TabItem>
106111
<TabItem value="ts" label="TypeScript">
107112

108-
109113
```ts title="src/client/vite.config.ts"
110114
import { defineConfig } from 'vite'
111115

112116
export default defineConfig({
113117
base: '/my-app/',
114118
})
115119
```
120+
116121
</TabItem>
117122
</Tabs>

web/docs/tutorial/02-project-structure.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ By _your code_, we mean the _"the code you write"_, as opposed to the code gener
3434
- `src/shared`: Contains code that may be executed on both the client and server.
3535

3636
Many of the other files (`tsconfig.json`, `vite-env.d.ts`, etc.) are used by your IDE to improve your development experience with tools like autocompletion, intellisense, and error reporting.
37+
The file `vite.config.ts` is used to configure [Vite](https://vitejs.dev/guide/), Wasp's build tool of choice.
38+
We won't be configuring Vite in this tutorial, so you can safely ignore the file. Still, if you ever end up wanting more control over Vite, you'll find everything you need to know in [custom Vite config docs](/docs/project/custom-vite-config.md).
3739

3840
:::note TypeScript Support
3941
Wasp supports TypeScript out of the box, but you are free to choose between or mix JavaScript and TypeScript as you see fit.

0 commit comments

Comments
 (0)