generated from railmapgen/__APP_NAME__
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvite.config.mts
58 lines (55 loc) · 1.79 KB
/
vite.config.mts
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
53
54
55
56
57
58
/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'node:url';
import * as path from 'node:path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vitejs.dev/config
export default defineConfig({
base: '/',
plugins: [react()],
build: {
rollupOptions: {
input: {
main: path.resolve(__dirname, 'index.html'),
contributors: path.resolve(__dirname, 'contributors', 'index.html'),
demo: path.resolve(__dirname, 'runtime-demo', 'index.html')
},
output: {
manualChunks: {
react: [
'react',
'react-dom',
'react-router-dom',
'@reduxjs/toolkit',
'react-redux',
'react-i18next',
],
mantine: ['@mantine/core', '@mantine/hooks', '@railmapgen/mantine-components'],
},
},
},
},
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',
server: {
deps: {
fallbackCJS: false,
},
},
watch: false,
},
});