A rollup plugin that imports component library styles on demand
yarn add @jonath/rollup-plugin-style-import -D
or
npm i @jonath/rollup-plugin-style-import -D
import { Button } from 'ant-design-vue';
↓ ↓ ↓ ↓ ↓ ↓
import { Button } from 'ant-design-vue';
import 'ant-design-vue/es/button/style/index.css';
import styleImport from "@jonath/rollup-plugin-style-import";
styleImport({
libs: [
{
libName: "ant-design-vue",
nodeModule: true,
resolveStyle: (name) => {
return `ant-design-vue/es/${name}/style/index`;
},
},
],
});