Skip to content

Commit 8f88a79

Browse files
authored
Remove alias section
Removed the alias section and added a note under the first template/code example using the @ alias.
1 parent 8f6e76a commit 8f88a79

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,6 @@ export default defineConfig({
4040
});
4141
```
4242

43-
For convenience, you may also wish to register aliases for importing the generated files into your application:
44-
45-
```ts
46-
import path from 'path';
47-
48-
export default defineConfig({
49-
// ...
50-
resolve: {
51-
alias: {
52-
"@": path.resolve(__dirname, "./resources/js"),
53-
},
54-
},
55-
});
56-
```
57-
5843
## Generating TypeScript Definitions
5944

6045
The `wayfinder:generate` command can be used to generate TypeScript definitions for your routes and controller methods:
@@ -87,6 +72,8 @@ import { show } from "@/actions/App/Http/Controllers/PostController";
8772

8873
show(1); // { url: "/posts/1", method: "get" }
8974
```
75+
> [!NOTE]
76+
> The @ alias can be used for convenience. It's available by default when using [Laravel Vite Plugin](https://github.com/laravel/vite-plugin). To let Typescript also understand this alias, make sure it's configured in your tsconfig.json in the paths section under compilerOptions: `"paths": {"@/*": ["./resources/js/*"]}`.
9077
9178
If you just need the URL, or would like to choose a method from the HTTP methods defined on the server, you can invoke additional methods on the Wayfinder generated function:
9279

0 commit comments

Comments
 (0)