vite.config.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import vue from "@vitejs/plugin-vue"
  2. import dts from "vite-plugin-dts"
  3. import path from "path"
  4. import Icons from "unplugin-icons/vite"
  5. import { defineConfig } from "vite"
  6. import WindiCSS from "vite-plugin-windicss"
  7. import { VitePluginFonts } from "vite-plugin-fonts"
  8. export default defineConfig({
  9. plugins: [
  10. vue(),
  11. dts({
  12. insertTypesEntry: true,
  13. skipDiagnostics: true,
  14. outputDir: ['dist']
  15. }),
  16. WindiCSS({
  17. root: path.resolve(__dirname),
  18. }),
  19. Icons({
  20. compiler: "vue3"
  21. }),
  22. VitePluginFonts({
  23. google: {
  24. families: [
  25. "Inter:wght@400;500;600;700;800",
  26. "Roboto+Mono:wght@400;500",
  27. "Material+Icons",
  28. ],
  29. },
  30. }),
  31. ], // to process SFC
  32. build: {
  33. sourcemap: true,
  34. minify: false,
  35. lib: {
  36. entry: path.resolve(__dirname, "src/index.ts"),
  37. name: "hopp-ui",
  38. formats: ["es"],
  39. fileName: (format, entry) => `${entry}.${format}.js`,
  40. },
  41. rollupOptions: {
  42. external: ["vue", "vue-router"],
  43. output: {
  44. exports: "named",
  45. },
  46. },
  47. emptyOutDir: true
  48. },
  49. })