vite-plugin-alias-import-checker
v0.1.0
Published
A vite plugin designed to validate and ensure the correctness of alias imports in your project.
Downloads
125
Maintainers
Readme
English | 中文
🔥 Features
- Support different files —— 👉 .js, .jsx, .ts, .tsx, .vue, .svelte, and .astro
- support error level: error | warn
for more usage please see the examples
📦 Install
pnpm add vite-plugin-alias-import-checker -D
# or
yarn add vite-plugin-alias-import-checker -D
# or
npm i vite-plugin-alias-import-checker -D
⚙️ Options
interface Options {
/** default error */
level?: 'warn' | 'error'
}
🔨 Usage
import { defineConfig } from 'vite'
import aliasImportChecker from 'vite-plugin-alias-import-checker'
const config = defineConfig({
plugins: [
aliasImportChecker(),
],
})
export default config
👇 Example
Clone the project and start playgrounds by running:
pnpm play # corresponding to vue
# or
pnpm play:react # corresponds to react
pnpm play:astro # corresponds to astro
For specific configuration, see vue/vite.config.ts or react/vite.config.ts, astro.config.mjs
📄 License
vite-plugin-alias-import-checker is MIT licensed.