vite.config.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 Unfonts from "unplugin-fonts/vite"
  8. export default defineConfig({
  9. plugins: [
  10. vue(),
  11. dts({
  12. insertTypesEntry: true,
  13. outDir: ["dist"],
  14. }),
  15. WindiCSS({
  16. root: path.resolve(__dirname),
  17. }),
  18. Icons({
  19. compiler: "vue3",
  20. }),
  21. Unfonts({
  22. fontsource: {
  23. families: [
  24. {
  25. name: "Inter Variable",
  26. variables: ["variable-full"],
  27. },
  28. {
  29. name: "Material Symbols Rounded Variable",
  30. variables: ["variable-full"],
  31. },
  32. {
  33. name: "Roboto Mono Variable",
  34. variables: ["variable-full"],
  35. },
  36. ],
  37. },
  38. }),
  39. ], // to process SFC
  40. build: {
  41. sourcemap: true,
  42. minify: false,
  43. lib: {
  44. entry: path.resolve(__dirname, "src/index.ts"),
  45. name: "hopp-ui",
  46. formats: ["es"],
  47. fileName: (format, entry) => `${entry}.${format}.js`,
  48. },
  49. rollupOptions: {
  50. external: ["vue", "vue-router"],
  51. output: {
  52. exports: "named",
  53. },
  54. },
  55. emptyOutDir: true,
  56. },
  57. })