-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
46 lines (45 loc) · 1.41 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
35
36
37
38
39
40
41
42
43
44
45
46
import {defineConfig} from "vite"
import path from "path"
import tsconfigPaths from "vite-tsconfig-paths"
import {globSync} from "glob"
import {fileURLToPath} from "node:url"
export default defineConfig({
plugins: [tsconfigPaths()],
build: {
rollupOptions: {
input: Object.fromEntries(
globSync("src/**/*.ts").map(file => [
path.relative(
"src",
file.slice(0, file.length - path.extname(file).length)
),
fileURLToPath(new URL(file, import.meta.url))
])
),
output: [
{
entryFileNames: "[name].js",
chunkFileNames: "[name]-[hash].js",
format: "esm",
dir: "dist/esm"
},
{
entryFileNames: "[name].js",
chunkFileNames: "[name]-[hash].js",
format: "cjs",
dir: "dist/cjs"
}
],
external: ["path", "stream", "@skyrim-platform/skyrim-platform"],
preserveEntrySignatures: "allow-extension"
}
},
test: {
include: ["./test/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["json-summary", "html"],
exclude: ["docs"]
}
}
})