forked from onsetsoftware/automerge-patcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
34 lines (32 loc) · 829 Bytes
/
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
import { defineConfig } from "vite";
import path from "path";
import dts from "vite-plugin-dts";
import wasm from "vite-plugin-wasm"
import topLevelAwait from "vite-plugin-top-level-await"
import { externalizeDeps } from "vite-plugin-externalize-deps";
const resolvePath = (str: string) => path.resolve(__dirname, str);
// https://vitejs.dev/config/
export default defineConfig({
build: {
target: "esnext",
lib: {
entry: resolvePath("src/index.ts"),
name: "AutomergePatcher",
fileName: (format) => `automerge-patcher.${format}.js`,
},
},
plugins: [
externalizeDeps(),
topLevelAwait(),
wasm(),
dts({
entryRoot: resolvePath("src"),
outputDir: resolvePath("dist/types"),
}),
],
optimizeDeps: {
exclude: [
"@automerge/automerge-wasm",
]
}
});