christian-hackyourshack / npm

19 stars 3 forks source link

Include directive - tsconfig paths support #40

Closed phenomen closed 1 year ago

phenomen commented 1 year ago

I use tsconfig paths for layouts, components, images and other shortcuts. But in Include directive it doesn't work and unable to resolve the path.

tsconfig.json

{
  "extends": "astro/tsconfigs/base",
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@gear": ["./src/data/gear/*"]
    }
  }
}

page.mdx

::include[@gear/backpack.mdx]

I have hundreds of categories, pages, and products and using ./, ../, ../../, etc. is just unfeasible. It would be nice to be able to use shortcuts in include directives.