vue-vben-admin/build/vite/plugin/styleImport.ts
2021-03-10 00:05:27 +08:00

23 lines
505 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() {
// if (!isBuild) return [];
const pwaPlugin = styleImport({
libs: [
{
libraryName: 'ant-design-vue',
esModule: true,
resolveStyle: (name) => {
return `ant-design-vue/es/${name}/style/index`;
},
},
],
});
return pwaPlugin;
}