Skip to content

Commit

Permalink
Include runtime checksum within sites build config
Browse files Browse the repository at this point in the history
  • Loading branch information
uditdc committed Aug 22, 2024
1 parent a51a49b commit c5e9817
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/commands/sites/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from "path"
import { parseBlsConfig } from "../../lib/blsConfig"
import { logger } from "../../lib/logger"
import { createWasmArchive, createWasmManifest } from '../function/shared'
import { generateMd5Checksum } from '../../lib/crypto'
import { generateMd5Checksum, generateSha256Checksum } from '../../lib/crypto'
import { buildSiteWasm } from './shared'
import { slugify } from '../../lib/strings'

Expand Down Expand Up @@ -51,6 +51,13 @@ export const run = async (options: {
// Create a WASM archive
createWasmArchive(buildDir, wasmArchive, wasmName)

wasmManifest.runtime = {
url: wasmArchive,
checksum: generateSha256Checksum(
fs.readFileSync(`${buildDir}/${wasmArchive}`),
),
}

wasmManifest.modules?.push({
file: wasmName,
name: wasmName.split(".")[0],
Expand Down

0 comments on commit c5e9817

Please sign in to comment.