31 lines
791 B
TypeScript
31 lines
791 B
TypeScript
import { resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
|
|
const packageRoot = fileURLToPath(new URL(".", import.meta.url));
|
|
|
|
export default defineConfig({
|
|
root: resolve(packageRoot, "examples"),
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: "@paperclipai/paperclip-runner/standalone",
|
|
replacement: resolve(packageRoot, "src/standalone/index.ts"),
|
|
},
|
|
],
|
|
},
|
|
server: { host: "127.0.0.1" },
|
|
preview: { host: "127.0.0.1" },
|
|
build: {
|
|
outDir: resolve(packageRoot, "dist-standalone"),
|
|
emptyOutDir: true,
|
|
target: "esnext",
|
|
rollupOptions: {
|
|
input: resolve(packageRoot, "examples/standalone-demo/index.html"),
|
|
},
|
|
},
|
|
});
|