vite-plugin-css
v1.0.4
Published
提供组件库的样式按需加载
Downloads
2,566
Readme
vite-css-plugin
Install
npm install -D vite-css-plugin
# or
yarn add -D vite-css-plugin
Usage
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import css from 'vite-css-plugin';
export default defineConfig({
plugins: [vue(), css({
name: 'ant-design-vue',
tranfrom(component) {
let name = component;
if (/Row|Col/.test(component)) name = 'grid';
return `lib/${name.toLowerCase()}/style/index.css`;
}
})]
})
input
import { Button } from 'ant-design-vue';
output
import 'ant-design-vue/lib/button/style/index.css';
import { Button } from 'ant-design-vue';