vite.config.ts 756 B

1234567891011121314151617181920212223242526272829303132
  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. },
  30. },
  31. });