Files

17 lines
586 B
JavaScript
Raw Permalink Normal View History

2026-03-15 20:44:03 +00:00
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";
import { writeTextFileIfChanged } from "./runtime-postbuild-shared.mjs";
2026-03-15 20:44:03 +00:00
export function copyPluginSdkRootAlias(params = {}) {
const cwd = params.cwd ?? process.cwd();
const source = resolve(cwd, "src/plugin-sdk/root-alias.cjs");
const target = resolve(cwd, "dist/plugin-sdk/root-alias.cjs");
2026-03-15 20:44:03 +00:00
writeTextFileIfChanged(target, readFileSync(source, "utf8"));
}
2026-03-15 20:44:03 +00:00
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
copyPluginSdkRootAlias();
}