vite-import-plugin
v1.0.0
Published
Vite transform import plugin
Downloads
3
Maintainers
Readme
vite-import-plugin
Usage
import viteImportPlugin from "vite-import-plugin";
// vite.config.ts
export default defineConfig({
plugins: [
viteImportPlugin({
libraryName : "vant",
libraryDirectory : "/es",
stylePath : (component) => {
return `vant/es/${component.toLowerCase()}/style`
},
debug : true
}),
vue()
]
})
Options
1. libraryName (required)
指定要转换的库名
2. libraryDirectory (required)
指定库中对应的组建目录
3. stylePath
指定组件对应的样式文件地址
4. destructionMode (default : true)
是否用解构的方式引入组件
5. debug (default : false)
开启debug