harden v2 custom widgets and workshop
This commit is contained in:
1 parent
e8a2c87c2d
commit
723b46926a
194 files changed
+44862
-1265
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import { build } from "esbuild";
|
||||
|
||||
const repositoryRoot = resolve(import.meta.dirname, "..");
|
||||
const outfile = resolve(repositoryRoot, "apps/workshop/pb_hooks/widget-validator.bundle.cjs");
|
||||
|
||||
await build({
|
||||
entryPoints: [resolve(repositoryRoot, "packages/workshop/src/pocketbase-validator.ts")],
|
||||
bundle: true,
|
||||
platform: "neutral",
|
||||
format: "cjs",
|
||||
target: "es2015",
|
||||
mainFields: ["module", "main"],
|
||||
outfile,
|
||||
});
|
||||
|
||||
const bundle = await readFile(outfile, "utf8");
|
||||
await writeFile(outfile, bundle.replace(/[ \t]+$/gmu, ""), "utf8");
|
||||
Reference in new issue
Block a user