-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
44 lines (42 loc) · 1.17 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
import { defineConfig, type UserConfig } from "vite";
import type { InlineConfig } from "vitest";
import path from "path";
import dts from "vite-plugin-dts";
interface VitestConfigExport extends UserConfig {
test: InlineConfig;
}
export default defineConfig({
build: {
minify: false,
sourcemap: true,
lib: {
entry: path.resolve(__dirname, "source/index.ts"),
name: "ftrack-javascript-api",
fileName: (format) =>
`ftrack-javascript-api.${format}.${format === "umd" ? "cjs" : "js"}`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ["moment", "uuid", "loglevel", "isomorphic-ws"],
output: {
globals: {
"ftrack-javascript-api": "ftrack",
moment: "moment",
uuid: "uuid",
loglevel: "log",
"isomorphic-ws": "WebSocket",
},
},
},
},
plugins: [
dts({ rollupTypes: false, entryRoot: "source", include: "source" }),
],
test: {
environment: "jsdom",
globals: true,
globalSetup: "./vitest.globalsetup.js",
setupFiles: ["./vitest.setup.js"],
},
} as VitestConfigExport);