-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathvite.config.mts
More file actions
105 lines (95 loc) · 3.18 KB
/
vite.config.mts
File metadata and controls
105 lines (95 loc) · 3.18 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import path from 'node:path';
import { defineConfig } from 'vite';
const viteConfig = defineConfig((configEnv) => {
const { mode } = configEnv;
return {
clearScreen: mode !== 'development',
resolve: {
alias: {
'capture-core': path.resolve(__dirname, 'src/core_modules/capture-core'),
'capture-core/*': path.resolve(__dirname, 'src/core_modules/capture-core/*'),
'capture-ui': path.resolve(__dirname, 'src/core_modules/capture-ui'),
'capture-ui/*': path.resolve(__dirname, 'src/core_modules/capture-ui/*'),
'capture-core-utils': path.resolve(__dirname, 'src/core_modules/capture-core-utils'),
'capture-core-utils/*': path.resolve(__dirname, 'src/core_modules/capture-core-utils/*'),
'@dhis2/rules-engine-javascript': path.resolve(__dirname, 'packages/rules-engine/src'),
},
},
define: {
global: 'window',
},
build: {
sourcemap: false,
},
optimizeDeps: {
include: [
// Core React libraries
'react',
'react-dom',
'react-router-dom',
'history',
'prop-types',
// State management
'redux',
'react-redux',
'redux-observable',
'redux-batched-actions',
'reselect',
'rxjs',
// Query and data fetching
'@tanstack/react-query',
'@tanstack/react-query-devtools',
// DHIS2 libraries
'@dhis2/ui',
'@dhis2/app-runtime',
'@dhis2/rule-engine',
'@dhis2/d2-i18n',
'@dhis2/d2-ui-rich-text',
// Map libraries
'leaflet',
'leaflet-draw',
'react-leaflet',
'react-leaflet-draw',
'react-leaflet-search-unpolyfilled',
// Utilities
'lodash',
'uuid',
'moment',
'date-fns',
'loglevel',
'query-string',
// UI and styling
'@emotion/react',
'@emotion/react/jsx-dev-runtime',
'@emotion/css',
'react-jss',
'@popperjs/core',
'react-popper',
// Form and interaction
'react-select',
'react-dnd',
'react-dnd-html5-backend',
// Other libraries
'react-html-parser-ultimate',
'react-transform-tree',
'd2-utilizr',
],
esbuildOptions: {
target: 'esnext',
},
},
server: {
fs: {
cachedChecks: true,
strict: false,
},
watch: {
ignored: ['**/node_modules/**', '**/.d2/**'],
},
},
css: {
devSourcemap: false,
},
};
});
export default viteConfig;