Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active April 16, 2024 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/71902c12657094678275c5d80326bd9c to your computer and use it in GitHub Desktop.
Save cecilemuller/71902c12657094678275c5d80326bd9c to your computer and use it in GitHub Desktop.
Subpath Imports:
{
"imports": {
"#components/*": "./src/components/*",
"#functions/*": "./src/functions/*"
}
}
// VSCode, Vite and even Node know about the alias
import {MyComponent} from "#components/example.js";
// Also works with Typescript without having the paths in tsconfig nor resolve.alias
// import {MyComponent} from "#components/example.ts";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment