vite.config.ts 1.3 KB

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