feat: add @/ path alias to generated projects (#3562)
Sets up `@/` as the default path alias in newly generated Fresh
projects, following the official Deno documentation guidelines. This
allows developers to use `@/` for absolute imports from the project root
instead of relative paths. This is especially convenient to remove
import that require deeply traversing up the directory tree.
The `@/` alias is now included in the imports section of deno.json for
all new projects, enabling cleaner import statements like:
```
import { Button } from "@/components/Button.tsx";
```
Fixes #3485
This commit is contained in:
@@ -574,6 +574,7 @@ if (Deno.args.includes("build")) {
|
||||
},
|
||||
exclude: ["**/_fresh/*"],
|
||||
imports: {
|
||||
"@/": "./",
|
||||
"fresh": `jsr:@fresh/core@^${freshVersion}`,
|
||||
"preact": `npm:preact@^${PREACT_VERSION}`,
|
||||
"@preact/signals": `npm:@preact/signals@^${PREACT_SIGNALS_VERSION}`,
|
||||
|
||||
Reference in New Issue
Block a user