vite.config.ts 882 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { resolve } from "path"
  2. import { defineConfig } from "vite"
  3. export default defineConfig({
  4. build: {
  5. outDir: "./dist",
  6. emptyOutDir: true,
  7. lib: {
  8. entry: {
  9. 'hoppscotch-kernel': resolve(__dirname, 'src/index.ts'),
  10. },
  11. formats: ['es', 'cjs']
  12. },
  13. rollupOptions: {
  14. external: [
  15. '@tauri-apps/api',
  16. '@tauri-apps/plugin-dialog',
  17. '@tauri-apps/plugin-fs',
  18. '@tauri-apps/plugin-shell',
  19. 'tauri-plugin-hoppscotch-relay-api',
  20. 'axios',
  21. 'fp-ts'
  22. ]
  23. }
  24. },
  25. resolve: {
  26. alias: {
  27. '~': resolve(__dirname, './src'),
  28. '@io': resolve(__dirname, './src/io'),
  29. '@relay': resolve(__dirname, './src/relay'),
  30. '@store': resolve(__dirname, './src/store'),
  31. '@type': resolve(__dirname, './src/type'),
  32. '@util': resolve(__dirname, './src/util')
  33. }
  34. }
  35. })