vite-plugin-one-code
v0.1.1
Published
Integration for babel-plugin-import and babel-plugin-module-resolver
Downloads
16
Maintainers
Readme
vite-plugin-one-code
Integration for babel-plugin-import and babel-plugin-module-resolver
use
config include babel-plugin-import
config include babel-plugin-module-resolver
npm install vite-plugin-one-code --save
yarn add vite-plugin-one-code
// vite.config.js
import { defineConfig } from "vite";
import usePluginOneCode from 'vite-plugin-one-code'
export default defineConfig({
plugins: [
... // other plugins
usePluginOneCode({
import: {
libraryName: "ant-design-vue",
libraryDirectory: "es",
style: true,
},
resolver: {
{
alias: {
// 自定义组件映射, 也可以是第三方库。 @ -> .src/
'@/pages/Home/components/DemoComponent': '@/pages/Home/components/DemoComponent/mobile',
}
}
}
}),
usePluginOneCode({
import: {
libraryName: "antd",
libraryDirectory: "es",
style: true,
}
}),
// Other configurations welcome PR
];
})