vite.config.mts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { defineConfig } from 'vite';
  2. import * as path from 'path';
  3. import reactRefresh from '@vitejs/plugin-react';
  4. import svgr from '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. svgr({
  19. // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include.
  20. include: '**/*.svg?react',
  21. // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
  22. exclude: '',
  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. });