-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
34 lines (33 loc) · 1.05 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
import {defineConfig} from "vite"
import inject from "@rollup/plugin-inject"
export default defineConfig({
// Base path for references to asset files in the built code.
// Setting this to empty causes assets to be imported from a
// relative path, which is necessary if your app is deployed
// to a subdirectory (e.g. https://benchristel.github.io/my-app/)
base: "",
esbuild: {
jsxFactory: "h",
jsxFragment: "Fragment",
},
plugins: [
inject({
include: "src/**/*.{ts,tsx,js,jsx}",
test: ["@benchristel/taste", "test"],
expect: ["@benchristel/taste", "expect"],
is: ["@benchristel/taste", "is"],
equals: ["@benchristel/taste", "equals"],
not: ["@benchristel/taste", "not"],
which: ["@benchristel/taste", "which"],
debug: ["@benchristel/taste", "debug"],
}),
],
resolve: {
alias: {
"react": "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat", // Must be below test-utils
"react/jsx-runtime": "preact/jsx-runtime",
},
},
})