24 lines
543 B
TypeScript
24 lines
543 B
TypeScript
![]() |
/**
|
||
|
* Introduces component library styles on demand.
|
||
|
* https://github.com/anncwb/vite-plugin-style-import
|
||
|
*/
|
||
|
import styleImport from 'vite-plugin-style-import';
|
||
|
|
||
|
export function configStyleImportPlugin(isBuild: boolean) {
|
||
|
if (!isBuild) {
|
||
|
return [];
|
||
|
}
|
||
|
const styleImportPlugin = styleImport({
|
||
|
libs: [
|
||
|
{
|
||
|
libraryName: 'ant-design-vue',
|
||
|
esModule: true,
|
||
|
resolveStyle: (name) => {
|
||
|
return `ant-design-vue/es/${name}/style/index`;
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
});
|
||
|
return styleImportPlugin;
|
||
|
}
|