styleImport.ts 475 B

123456789101112131415161718192021
  1. /**
  2. * Introduces component library styles on demand.
  3. * https://github.com/anncwb/vite-plugin-style-import
  4. */
  5. import styleImport from 'vite-plugin-style-import';
  6. export function configStyleImportPlugin() {
  7. const pwaPlugin = styleImport({
  8. libs: [
  9. {
  10. libraryName: 'ant-design-vue',
  11. esModule: true,
  12. resolveStyle: (name) => {
  13. return `ant-design-vue/es/${name}/style/index`;
  14. },
  15. },
  16. ],
  17. });
  18. return pwaPlugin;
  19. }