-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathvite.config.mts
More file actions
52 lines (50 loc) · 1.66 KB
/
vite.config.mts
File metadata and controls
52 lines (50 loc) · 1.66 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
47
48
49
50
51
52
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'node:url';
import * as path from 'node:path';
import { coverageConfigDefaults } from 'vitest/config';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vitejs.dev/config
export default defineConfig({
base: '/',
plugins: [react()],
build: {
rolldownOptions: {
input: {
main: path.resolve(__dirname, 'index.html'),
contributors: path.resolve(__dirname, 'contributors', 'index.html'),
demo: path.resolve(__dirname, 'runtime-demo', 'index.html'),
},
output: {
codeSplitting: {
groups: [
{ test: /node_modules\/react/, name: 'react' },
{ test: /node_modules\/@mantine/, name: 'mantine' },
],
},
},
},
},
server: {
proxy: {
'^(/rmg/|/rmp/|/rmg-palette/|/rmg-template/|/rmg-templates/|/rmp-gallery/|/rmp-designer/|/mantine-components/|/svg-assets/|/rmg-translate/|/__APP_NAME__/|/rmg-runtime/)':
{
target: 'https://railmapgen.github.io',
changeOrigin: true,
secure: false,
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.ts',
watch: false,
coverage: {
provider: 'v8',
exclude: coverageConfigDefaults.exclude,
skipFull: true,
},
},
});