52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import dts from "vite-plugin-dts";
|
|
|
|
export default defineConfig({
|
|
root: __dirname,
|
|
cacheDir:
|
|
"../../../../node_modules/.vite/packages/api-sandbox-wasm-host-bridge",
|
|
plugins: [
|
|
dts({
|
|
entryRoot: "src",
|
|
tsconfigPath: "./tsconfig.lib.json",
|
|
insertTypesEntry: true,
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: "./dist",
|
|
emptyOutDir: true,
|
|
reportCompressedSize: true,
|
|
sourcemap: true,
|
|
lib: {
|
|
entry: {
|
|
index: "src/index.ts",
|
|
"bridge/index": "src/bridge/index.ts",
|
|
"abi-direct/wasm-abi/index": "src/abi-direct/wasm-abi/index.ts",
|
|
"abi-direct/marshal/index": "src/abi-direct/marshal/index.ts",
|
|
"abi-direct/memory/index": "src/abi-direct/memory/index.ts",
|
|
"wasi-stdio/index": "src/wasi-stdio/index.ts",
|
|
"abi-wasi-stdio/index": "src/abi-wasi-stdio/index.ts",
|
|
"route-discovery/index": "src/route-discovery/index.ts",
|
|
"testing/wasm-host-bridge-conformance/index":
|
|
"src/testing/wasm-host-bridge-conformance/index.ts",
|
|
},
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
treeshake: true,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
entryFileNames: "[name].js",
|
|
},
|
|
external: [
|
|
/^@suaveplan\//,
|
|
/^@opentelemetry\//,
|
|
/^node:/,
|
|
"tslib",
|
|
"zod",
|
|
],
|
|
},
|
|
},
|
|
});
|