vite.config.ts 877 B

12345678910111213141516171819202122232425262728293031323334
  1. import { defineConfig } from 'vite';
  2. import * as path from 'path';
  3. import reactRefresh from '@vitejs/plugin-react';
  4. const svgrPlugin = require('vite-plugin-svgr');
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. base: '',
  8. // This changes the out put dir from dist to build
  9. // comment this out if that isn't relevant for your project
  10. build: {
  11. outDir: 'build',
  12. },
  13. server: {
  14. port: 3001,
  15. },
  16. plugins: [
  17. reactRefresh(),
  18. svgrPlugin({
  19. svgrOptions: {
  20. icon: true,
  21. // ...svgr options (https://react-svgr.com/docs/options/)
  22. },
  23. }),
  24. ],
  25. resolve: {
  26. // extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json"],
  27. alias: {
  28. '@': path.resolve(__dirname, './src'),
  29. // be careful to include server modules in the client
  30. '@server': path.resolve(__dirname, './../server/src'),
  31. },
  32. },
  33. });