vitepacktest.mjs 505 B

123456789101112131415
  1. import { build } from "vite";
  2. import { fileURLToPath } from "node:url";
  3. const configFile = fileURLToPath(new URL("../../apps/dev/vite.config.ts", import.meta.url));
  4. const root = fileURLToPath(new URL("../../apps/dev", import.meta.url));
  5. const out = "/tmp/opencode/vite-out-test2";
  6. await build({
  7. configFile,
  8. root,
  9. base: "./",
  10. define: { __NENGINE_BUNDLE_DEFAULT__: JSON.stringify("../bundle.json") },
  11. build: { outDir: out, emptyOutDir: false },
  12. logLevel: "warn",
  13. });
  14. console.log("done:", out);