67 lines
2.3 KiB
TypeScript
67 lines
2.3 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/react-control-surface",
|
|
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",
|
|
"error-codes/index": "src/error-codes/index.ts",
|
|
"telemetry/index": "src/telemetry/index.ts",
|
|
"skin/index": "src/skin/index.ts",
|
|
"grouping/index": "src/grouping/index.ts",
|
|
"runtime/binding-registry/index":
|
|
"src/runtime/binding-registry/index.ts",
|
|
"controls/text-label/text-label":
|
|
"src/controls/text-label/text-label.tsx",
|
|
"controls/image/image": "src/controls/image/image.tsx",
|
|
"controls/led/led": "src/controls/led/led.tsx",
|
|
"controls/switch-2/switch-2":
|
|
"src/controls/switch-2/switch-2.tsx",
|
|
"controls/switch-3/switch-3":
|
|
"src/controls/switch-3/switch-3.tsx",
|
|
"controls/button-momentary/button-momentary":
|
|
"src/controls/button-momentary/button-momentary.tsx",
|
|
"controls/button-latching/button-latching":
|
|
"src/controls/button-latching/button-latching.tsx",
|
|
},
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
treeshake: true,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
entryFileNames: "[name].js",
|
|
},
|
|
external: [
|
|
"@opentelemetry/api",
|
|
"@suaveplan/control-surface-schema",
|
|
"@suaveplan/error",
|
|
"@suaveplan/react-audio",
|
|
"@suaveplan/react-midi",
|
|
"react",
|
|
"react-dom",
|
|
"react/jsx-runtime",
|
|
"tslib",
|
|
/^node:/,
|
|
],
|
|
},
|
|
},
|
|
});
|