-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (40 loc) · 1.15 KB
/
vite.config.ts
File metadata and controls
41 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import yaml from '@rollup/plugin-yaml'
import { imagetools } from 'vite-imagetools'
import { crmApiPlugin } from './server/api-plugin'
// https://vite.dev/config/
export default defineConfig({
plugins: [
react(),
yaml(),
imagetools(),
// CRM API endpoints for cv-dashboard
crmApiPlugin(),
// Serve static directories from public/ correctly in dev
{
name: 'static-directory-middleware',
configureServer(server) {
server.middlewares.use((req, _res, next) => {
// Redirect /cv-dashboard or /cv-dashboard/ to /cv-dashboard/index.html
if (req.url === '/cv-dashboard' || req.url === '/cv-dashboard/') {
req.url = '/cv-dashboard/index.html';
}
next();
});
}
}
],
base: '/',
build: {
rollupOptions: {
output: {
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-markdown': ['react-markdown', 'react-syntax-highlighter', 'remark-gfm'],
'vendor-motion': ['framer-motion'],
}
}
}
}
})