-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
86 lines (84 loc) · 2.25 KB
/
vite.config.ts
File metadata and controls
86 lines (84 loc) · 2.25 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
import VueI18n from "@intlify/unplugin-vue-i18n/vite"
import tailwindcss from "@tailwindcss/vite"
import vue from "@vitejs/plugin-vue"
import path from "path"
import license from "rollup-plugin-license"
import url from "url"
import istanbul from "vite-plugin-istanbul"
import { configDefaults, defineConfig } from "vitest/config"
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
// https://vite.dev/config/
// https://vitest.dev/config/
export default defineConfig({
define: {
__VUE_OPTIONS_API__: false,
},
plugins: [
vue(),
VueI18n({
include: [path.resolve(__dirname, "src/locales/**")],
runtimeOnly: true,
compositionOnly: true,
dropMessageCompiler: true,
fullInstall: true,
forceStringify: true,
}),
istanbul({
include: "src/**/*",
exclude: ["node_modules", "tests/"],
extension: [".js", ".ts", ".vue"],
// Only instrument for E2E coverage when VITE_COVERAGE is set to "true".
requireEnv: true,
forceBuildInstrument: true,
}),
license({
sourcemap: true,
thirdParty: {
includeSelf: true,
allow: {
test: "(Apache-2.0 OR MIT OR BSD-2-Clause OR BSD-3-Clause OR ISC)",
failOnUnlicensed: true,
failOnViolation: true,
},
output: {
file: path.join(__dirname, "dist", "NOTICE.txt"),
},
},
}),
tailwindcss(),
],
server: {
strictPort: true,
hmr: {
// We use a different port for HMR so that it goes
// through our Go development proxy.
clientPort: 8080,
},
},
resolve: {
alias: {
"@": "/src",
},
},
build: {
sourcemap: true,
target: ["esnext"],
// We have dist.go file in dist directory.
// We empty it ourselves in Makefile.
emptyOutDir: false,
},
test: {
exclude: [...configDefaults.exclude, "**/tests/**"],
setupFiles: ["src/test-setup.ts"],
coverage: {
include: ["src/**/*.{ts,vue}"],
exclude: ["**/tests/**", "**/*.d.ts"],
provider: "istanbul", // Required for nyc compatibility.
reporter: ["json", "html", "text"], // JSON required for nyc compatibility.
reportsDirectory: "./coverage/vitest",
},
},
esbuild: {
legalComments: "none",
},
})