-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (34 loc) · 889 Bytes
/
vite.config.ts
File metadata and controls
37 lines (34 loc) · 889 Bytes
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import mdx from '@mdx-js/rollup'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
const base = ''
// For testing purpose, we can use a specific date as: "2024-01-15T10:30:00.000Z"
const buildDate = new Date().toISOString()
// https://vite.dev/config/
export default defineConfig({
plugins: [mdx(), react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
define: {
// Inject build date at build time
'import.meta.env.VITE_BUILD_DATE': JSON.stringify(buildDate)
},
base: base,
build: {
outDir: 'upload/demo',
rollupOptions: {
output: {
manualChunks: {
react: ['react', 'react-dom'],
chartjs: ['chart.js'],
router: ['@tanstack/react-router']
}
}
}
}
})