-
Notifications
You must be signed in to change notification settings - Fork 569
/
vite.config.js
65 lines (60 loc) · 1.38 KB
/
vite.config.js
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
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable spaced-comment */
/* eslint-disable import/no-default-export */
/// <reference types="vitest" />
// Configure Vitest (https://vitest.dev/config/)
/* @flow */
import { defineConfig } from "vite";
import { flowPlugin, esbuildFlowPlugin } from "@bunchtogether/vite-plugin-flow";
const define = {
__DEBUG__: false,
__TEST__: true,
__WEB__: true,
__POST_ROBOT__: JSON.stringify({
__GLOBAL_KEY__: `__post_robot__`,
__AUTO_SETUP__: false,
__IE_POPUP_SUPPORT__: false,
__GLOBAL_MESSAGE_SUPPORT__: true,
__SCRIPT_NAMESPACE__: false,
}),
__PAYPAL_CHECKOUT__: JSON.stringify({
_MAJOR_VERSION__: "",
__MINOR_VERSION__: "",
}),
__DISABLE_SET_COOKIE__: false,
__EXPERIMENTATION__: {
__EXPERIENCE__: "",
__TREATMENT__: "",
},
};
// $FlowIssue
export default defineConfig({
esbuild: {
define,
},
define,
test: {
environment: "jsdom",
setupFiles: ["vitestSetup.js"],
include: ["**/src/**/*.test.{js,jsx}"],
globals: true,
coverage: {
// exclude untested files
all: false,
include: ["src"],
provider: "v8",
reportsDirectory: "./coverage/vitest",
},
},
optimizeDeps: {
esbuildOptions: {
plugins: [esbuildFlowPlugin()],
},
},
plugins: [
// $FlowIssue
flowPlugin({
exclude: "",
}),
],
});