1
0

style-import.ts 808 B

123456789101112131415161718192021222324252627
  1. import styleImport from 'vite-plugin-style-import';
  2. export function configStyleImportConfig() {
  3. const pwaPlugin = styleImport({
  4. libs: [
  5. {
  6. libraryName: 'ant-design-vue',
  7. resolveStyle: (name) => {
  8. // ! col row popconfirm These three components have no corresponding css files after packaging. Need special treatment
  9. if (['col', 'row'].includes(name)) {
  10. return 'ant-design-vue/lib/grid/style/index.css';
  11. }
  12. if (['popconfirm'].includes(name)) {
  13. return [
  14. 'ant-design-vue/lib/popover/style/index.css',
  15. 'ant-design-vue/lib/button/style/index.css',
  16. ];
  17. }
  18. return `ant-design-vue/lib/${name}/style/index.css`;
  19. },
  20. },
  21. ],
  22. });
  23. return pwaPlugin;
  24. }