Skip to content

Commit b5a5b92

Browse files
Merge pull request #67 from laravel/wayfinder-vite-plugin
Wayfinder Vite plugin
2 parents 78f86fb + 0e6ecc8 commit b5a5b92

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,29 @@ To get started, install Wayfinder via the Composer package manager:
1515
composer require laravel/wayfinder
1616
```
1717

18-
We also recommend installing and configuring [`vite-plugin-run`](https://github.com/innocenzi/vite-plugin-run) to ensure that your routes are generated during Vite's build step and also whenever your files change while running the Vite's dev server.
18+
Next, install the [Wayfinder Vite plugin](https://github.com/laravel/vite-plugin-wayfinder) to ensure that your routes are generated during Vite's build step and also whenever your files change while running the Vite's dev server.
1919

2020
First, install the plugin via NPM:
2121

2222
```
23-
npm i -D vite-plugin-run
23+
npm i -D @laravel/vite-plugin-wayfinder
2424
```
2525

2626
Then, update your application's `vite.config.js` file to watch for changes to your application's routes and controllers:
2727

2828
```ts
29-
import { run } from "vite-plugin-run";
29+
import { wayfinder } from "@laravel/vite-plugin-wayfinder";
3030

3131
export default defineConfig({
3232
plugins: [
33+
wayfinder(),
3334
// ...
34-
run([
35-
{
36-
name: "wayfinder",
37-
run: ["php", "artisan", "wayfinder:generate"],
38-
pattern: ["routes/**/*.php", "app/**/Http/**/*.php"],
39-
},
40-
]),
4135
],
4236
});
4337
```
4438

39+
You can read about all of the plugin's configuration options in the [documentation](https://github.com/laravel/vite-plugin-wayfinder).
40+
4541
## Generating TypeScript Definitions
4642

4743
The `wayfinder:generate` command can be used to generate TypeScript definitions for your routes and controller methods:

0 commit comments

Comments
 (0)