Back to Astro

vite-plugin-config-alias

packages/astro/src/vite-plugin-config-alias/README.md

0.0.12482 B
Original Source

vite-plugin-config-alias

This adds aliasing support to Vite from tsconfig.json or jsconfig.json files.

Consider the following example configuration:

{
  "compilerOptions": {
    "paths": {
      "components:*": ["src/components/*.astro"]
    }
  }
}

With this configuration, the following imports would map to the same location.

js
import Test from '../components/Test.astro';

import Test from 'components/Test.astro';

import Test from 'components:Test';