vben-admin-thin-next/build/vite/plugin/styleImport.ts

23 lines
505 B
TypeScript
Raw Normal View History

2021-02-09 23:47:14 +08:00
/**
* Introduces component library styles on demand.
* https://github.com/anncwb/vite-plugin-style-import
*/
2021-01-18 22:42:35 +08:00
import styleImport from 'vite-plugin-style-import';
2021-03-10 00:05:27 +08:00
export function configStyleImportPlugin() {
// if (!isBuild) return [];
2021-01-18 22:42:35 +08:00
const pwaPlugin = styleImport({
libs: [
{
libraryName: 'ant-design-vue',
2021-01-18 23:37:36 +08:00
esModule: true,
2021-01-18 22:42:35 +08:00
resolveStyle: (name) => {
2021-01-27 21:15:38 +08:00
return `ant-design-vue/es/${name}/style/index`;
2021-01-18 22:42:35 +08:00
},
},
],
});
return pwaPlugin;
}