Skip to content

Commit 464da32

Browse files
committed
feat: vite notes
1 parent bf3c86f commit 464da32

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

content/configuration/vite.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ npm install @nativescript/vite
1717

1818
## Quick start (`init`)
1919

20-
To bootstrap an existing NativeScript app for Vite, run from your app root:
20+
To bootstrap an existing NativeScript app with Vite, you can first adjust your config.
21+
22+
### 1. Adjust nativescript.config.ts to use Vite
23+
24+
Make sure your `nativescript.config.ts` includes the following to use Vite as the bundler:
25+
26+
```ts
27+
export default {
28+
// ...
29+
bundler: "vite",
30+
bundlerConfigPath: "vite.config.ts",
31+
// ...
32+
};
33+
```
34+
35+
### 2. Init the config
36+
37+
Now run from your app root:
2138

2239
```bash
2340
npx nativescript-vite init
@@ -274,3 +291,18 @@ Be sure to have a proper security policy in place using something as follows:
274291
...
275292
</application>
276293
```
294+
295+
## Troubleshooting
296+
297+
If you run into issues or have questions, please visit the [NativeScript Community Discord](https://nativescript.org/discord).
298+
299+
If you see your app is not building with Vite, ensure that your `nativescript.config.ts` has the correct bundler set:
300+
301+
```ts
302+
export default {
303+
// ...
304+
bundler: "vite",
305+
bundlerConfigPath: "vite.config.ts",
306+
// ...
307+
};
308+
```

0 commit comments

Comments
 (0)