-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.mts
40 lines (39 loc) · 952 Bytes
/
vite.config.mts
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
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
export default defineConfig({
build: {
lib: {
entry: "src/bmap.ts",
name: "bmapjs",
formats: ["es", "cjs"],
fileName: (format) => `bmap.${format}.js`,
},
target: "node16",
rollupOptions: {
external: ["@bsv/sdk", "@msgpack/msgpack", "bpu-ts", "node-fetch"],
},
outDir: "dist",
sourcemap: true,
},
publicDir: false,
plugins: [
dts({
include: ["src/**/*.ts", "src/**/*.d.ts"],
outDir: "dist/types",
insertTypesEntry: true,
cleanVueFileName: true,
rollupTypes: true,
copyDtsFiles: false,
compilerOptions: {
preserveSymlinks: true,
skipLibCheck: true
},
afterBuild: () => {
console.log("Type declarations built successfully");
},
afterDiagnostic: (diagnostic) => {
console.log(diagnostic);
},
}),
],
});