forked from Cognigy/chat-components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
62 lines (61 loc) · 1.25 KB
/
vite.config.ts
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
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react-swc";
import svgr from "vite-plugin-svgr";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import GithubActionsReporter from "vitest-github-actions-reporter";
import dts from "vite-plugin-dts";
export default defineConfig({
plugins: [
react(),
cssInjectedByJsPlugin(),
svgr(),
dts({
insertTypesEntry: true,
include: ["src"],
}),
],
test: {
environment: "jsdom",
globals: true,
browser: {
name: "chrome",
enabled: true,
headless: true,
},
setupFiles: ["./test/preSetup.js", "./test/setup.js"],
css: {
modules: {
classNameStrategy: "non-scoped",
},
},
reporters: process.env.GITHUB_ACTIONS
? ["default", new GithubActionsReporter()]
: "default",
},
build: {
target: "modules", // = es2020 edge88 firefox78 chrome87 safari14 (vite 4.4.5)
sourcemap: true,
minify: false,
lib: {
entry: "src/index.ts",
name: "chat-components",
formats: ["es"],
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
format: "es",
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
},
resolve: {
alias: {
src: "/src",
test: "/test",
},
},
});