49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import dts from "vite-plugin-dts";
|
|
|
|
export default defineConfig({
|
|
root: __dirname,
|
|
cacheDir: "../../../../node_modules/.vite/packages/api-loader",
|
|
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",
|
|
"cache-bust/index": "src/cache-bust/index.ts",
|
|
"error-codes/index": "src/error-codes/index.ts",
|
|
"journal-entry/index": "src/journal-entry/index.ts",
|
|
"native-binding-detector/index":
|
|
"src/native-binding-detector/index.ts",
|
|
"resolver/index": "src/resolver/index.ts",
|
|
"rollback-journal/index": "src/rollback-journal/index.ts",
|
|
"testing/index": "src/testing/index.ts",
|
|
},
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
treeshake: true,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
entryFileNames: "[name].js",
|
|
},
|
|
external: [
|
|
"tslib",
|
|
"zod",
|
|
/^@suaveplan\//,
|
|
/^node:/,
|
|
],
|
|
},
|
|
},
|
|
});
|