-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mjs
71 lines (70 loc) · 2.16 KB
/
vite.config.mjs
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
import { resolve } from "path";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import react from "@vitejs/plugin-react";
export default defineConfig({
// Specify the path at which the application will be deployed on a server. The path MUST end with "/".
// To deploy at the root path, use "/" or remove the "base" property entirely.
base: "/AHRQ-CDS-Connect-PAIN-MANAGEMENT-SUMMARY/",
plugins: [
react(),
nodePolyfills({
// include polyfills for the modules that Vite/Rollup warns about
include: ["events", "timers", "fs"]
})
],
// Stub out large XML JS files that are referenced but not needed
resolve: {
alias: {
"./fhir/models": "/src/stubs/fhir-models.js",
"./modelInfos/fhir-modelinfo-1.6.xml.js":
"/src/stubs/fhir-modelinfo-stub.xml.js",
"./modelInfos/fhir-modelinfo-3.0.0.xml.js":
"/src/stubs/fhir-modelinfo-stub.xml.js",
"./modelInfos/fhir-modelinfo-4.0.0.xml.js":
"/src/stubs/fhir-modelinfo-stub.xml.js"
}
},
build: {
// default chunk size limit is 500, but that's nearly impossible due to large JSON files
chunkSizeWarningLimit: 1500,
// specify rollup options to enable multiple entry points and break chunks up to smaller sizes
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
launch: resolve(__dirname, "launch.html")
},
output: {
manualChunks: (id) => {
if (
/src[/\\]cql[/\\]dstu2[/\\]/.test(id) ||
/fhir-modelinfo-1\.0\.2\.xml\.js/.test(id)
) {
return "dstu2";
}
if (
/src[/\\]cql[/\\]r4[/\\]/.test(id) ||
/fhir-modelinfo-4\.0\.1\.xml\.js/.test(id)
) {
return "r4";
}
if (id.includes("node_modules")) {
return "vendor";
}
}
}
}
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.js',
css: true,
reporters: ['verbose'],
coverage: {
reporter: ['text', 'json', 'html'],
include: ['src/**/*'],
exclude: [],
}
}
});