-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
75 lines (73 loc) · 1.66 KB
/
Copy pathvite.config.js
File metadata and controls
75 lines (73 loc) · 1.66 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
import dts from "vite-plugin-dts";
import babel from "vite-plugin-babel";
import { playwright } from "@vitest/browser-playwright";
/**
* @type {import('vite').UserConfig}
*
* @see https://vite.dev/config/
* @see https://vitest.dev/config/
* @see https://github.com/qmhc/unplugin-dts
*/
export default {
plugins: [
babel({
enforce: "pre",
include: /\.tsx?$/,
babelConfig: {
plugins: [
[
"@babel/plugin-transform-typescript",
{ onlyRemoveTypeImports: true, allowDeclareFields: true },
],
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
],
},
}),
dts({
tsconfigPath: "./lib/tsconfig.json",
outDirs: "./dist/types",
}),
],
resolve: {
tsconfigPaths: true,
},
test: {
dir: "test",
passWithNoTests: true,
setupFiles: "test/setup.ts",
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: "chromium" }, { browser: "firefox" }],
},
coverage: {
enabled: true,
provider: "istanbul",
include: ["lib/**/*.ts"],
exclude: ["lib/BlinklikeHTMLCollection.ts"],
thresholds: {
90: true,
},
reporter: "text",
},
},
build: {
outDir: "dist",
lib: {
entry: "./lib/index.ts",
},
rolldownOptions: {
external: [/^@t15i\/(webidl-decorators|webidl-types|webspecs)(\/.*)?$/],
output: [
{
name: "htmlcollections",
format: "es",
dir: "dist/lib",
entryFileNames: "[name].js",
preserveModules: true,
minify: false,
},
],
},
},
};