-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
46 lines (45 loc) · 1.16 KB
/
vite.config.ts
File metadata and controls
46 lines (45 loc) · 1.16 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
42
43
44
45
46
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
import backloop from 'vite-plugin-backloop.dev';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const config: any = {
// Relative base so the same build works at GH-Pages root, sub-path, or under a custom domain.
base: './',
envPrefix: ['VITE_'],
server: {
host: '::',
port: 8090
},
plugins: [
react(),
tailwindcss()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
},
preserveSymlinks: true,
dedupe: ['hds-lib', 'react', 'react-dom']
},
optimizeDeps: {
include: ['hds-lib'],
exclude: ['hds-forms-js']
}
};
// Enable backloop.dev (HTTPS + proper hostname) by default in dev mode.
// Use `npm run dev:raw` to bypass it (plain http://localhost).
if (mode !== 'raw') {
config.plugins.push(backloop('app-data-model-browser'));
}
return {
...config,
test: {
globals: true,
environment: 'jsdom',
setupFiles: './vitest-setup.ts'
}
};
});