-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
26 lines (24 loc) 路 756 Bytes
/
Copy pathvite.config.ts
File metadata and controls
26 lines (24 loc) 路 756 Bytes
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
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [dts({ rollupTypes: true })],
build: {
lib: {
entry: {
"vitest-setup": resolve(__dirname, "./src/vitest/vitest-setup.ts"),
"vitest-context": resolve(__dirname, "./src/vitest/vitest-context.ts"),
},
name: "mocket.io-client",
fileName: (format, name) => {
return format === "es" ? `${name}.js` : `${name}.cjs`;
},
formats: ["es", "cjs"],
},
rollupOptions: {
external: ["socket.io-client", "vitest"],
},
},
});