You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
633 B

2 weeks ago
  1. import vue from '@vitejs/plugin-vue'
  2. import createAutoImport from './auto-import'
  3. import createSvgIcon from './svg-icon'
  4. import createCompression from './compression'
  5. import createSetupExtend from './setup-extend'
  6. export default function createVitePlugins(viteEnv, isBuild = false) {
  7. const vitePlugins = [vue({
  8. template: {
  9. compilerOptions: {
  10. isCustomElement: (tag) => tag === ('font')
  11. }
  12. }
  13. })]
  14. vitePlugins.push(createAutoImport())
  15. vitePlugins.push(createSetupExtend())
  16. vitePlugins.push(createSvgIcon(isBuild))
  17. isBuild && vitePlugins.push(...createCompression(viteEnv))
  18. return vitePlugins
  19. }