(artifact: {
readonly source: string;
readonly wasm: Uint8Array;
})
| 13 | createHash("sha256").update(value).digest("hex").slice(0, 12); |
| 14 | |
| 15 | const artifactPaths = (artifact: { |
| 16 | readonly source: string; |
| 17 | readonly wasm: Uint8Array; |
| 18 | }): { |
| 19 | readonly sourcePath: string; |
| 20 | readonly wasmPath: string; |
| 21 | } => ({ |
| 22 | sourcePath: `/assets/worker-bundler-source-${digest(artifact.source)}.js`, |
| 23 | wasmPath: `/assets/worker-bundler-esbuild-wasm-${digest(artifact.wasm)}.wasm`, |
| 24 | }); |
| 25 | |
| 26 | export const workerBundlerArtifact = (): Plugin => { |
| 27 | let command: "build" | "serve" = "build"; |
no test coverage detected