-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
56 lines (55 loc) · 1.34 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
/**
* @file Vite config.
*/
/// <reference types="vitest/config" />
import {codecovVitePlugin} from "@codecov/vite-plugin";
import {defineConfig} from "vite";
import {externalizeDeps} from "vite-plugin-externalize-deps";
import process from "node:process";
import {resolve} from "node:path";
import vitePluginDTS from "vite-plugin-dts";
export default defineConfig({
build: {
lib: {
entry: [
resolve(import.meta.dirname, "src/index.ts"),
resolve(import.meta.dirname, "src/cli.ts")
],
name: "wgconfgen"
},
rollupOptions: {
// Set by `externalizeDeps`
// external: ["..."],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: "Vue"
}
}
},
sourcemap: true
},
plugins: [
externalizeDeps(),
vitePluginDTS({
compilerOptions: {
declaration: true,
declarationMap: true
},
exclude: "**/*.test.*"
}),
codecovVitePlugin({
bundleName: "wgconfgen",
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
uploadToken: process.env.CODECOV_TOKEN
})
],
test: {
// Done by default.
// reporters:
// process.env.GITHUB_ACTIONS === undefined
// ? ["dot"]
// : ["dot", "github-actions"]
}
});