vite.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import { createSvgIconsPlugin } from '@digitalacorn/vite-plugin-svg-icons'
  4. import vue from '@vitejs/plugin-vue'
  5. import vueJsx from '@vitejs/plugin-vue-jsx'
  6. import VueDevTools from 'vite-plugin-vue-devtools'
  7. import path from 'path'
  8. // https://vitejs.dev/config/
  9. export default defineConfig({
  10. base: './',
  11. plugins: [
  12. vue(),
  13. vueJsx(),
  14. VueDevTools(),
  15. createSvgIconsPlugin({
  16. iconDirs: [path.resolve(process.cwd(), 'src/assets/svgs')],
  17. symbolId: 'icon-[dir]-[name]',
  18. svgoOptions: true,
  19. replaceStrokeWithCurrentColor: false
  20. }),
  21. ],
  22. resolve: {
  23. alias: {
  24. '@': fileURLToPath(new URL('./src', import.meta.url))
  25. },
  26. extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
  27. },
  28. css: {
  29. preprocessorOptions: {
  30. scss: {
  31. additionalData: `
  32. @import "@/assets/styles/mixins.scss";
  33. @import "@/assets/styles/variables.scss";`
  34. }
  35. }
  36. },
  37. server: {
  38. host: '0.0.0.0'
  39. },
  40. })