56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
import dts from "vite-plugin-dts";
|
|
|
|
export default defineConfig({
|
|
root: __dirname,
|
|
cacheDir: "../../../node_modules/.vite/packages/drive-react-sharing",
|
|
plugins: [
|
|
react(),
|
|
dts({
|
|
entryRoot: "src",
|
|
tsconfigPath: "./tsconfig.lib.json",
|
|
insertTypesEntry: true,
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: "./dist",
|
|
emptyOutDir: true,
|
|
reportCompressedSize: true,
|
|
sourcemap: true,
|
|
lib: {
|
|
entry: {
|
|
index: "src/index.ts",
|
|
"hooks/use-sharing/use-sharing":
|
|
"src/hooks/use-sharing/use-sharing.ts",
|
|
"components/share-dialog/share-dialog":
|
|
"src/components/share-dialog/share-dialog.tsx",
|
|
"components/partition-badge/partition-badge":
|
|
"src/components/partition-badge/partition-badge.tsx",
|
|
"components/file-access-list/file-access-list":
|
|
"src/components/file-access-list/file-access-list.tsx",
|
|
},
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
treeshake: true,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
entryFileNames: "[name].js",
|
|
},
|
|
external: [
|
|
"@opentelemetry/api",
|
|
"@suaveplan/drive-sharing",
|
|
"@suaveplan/error",
|
|
"@suaveplan/types",
|
|
"react",
|
|
"react-dom",
|
|
"react/jsx-runtime",
|
|
"tslib",
|
|
/^node:/,
|
|
],
|
|
},
|
|
},
|
|
});
|