15 lines
543 B
JavaScript
15 lines
543 B
JavaScript
import grabDirNames from "../../utils/grab-dir-names";
|
|
const { HYDRATION_DST_DIR_MAP_JSON_FILE } = grabDirNames();
|
|
export default async function recordArtifacts({ artifacts }) {
|
|
const artifacts_map = {};
|
|
for (const artifact of artifacts) {
|
|
if (artifact?.local_path) {
|
|
artifacts_map[artifact.local_path] = artifact;
|
|
}
|
|
}
|
|
if (global.BUNDLER_CTX_MAP) {
|
|
global.BUNDLER_CTX_MAP = artifacts_map;
|
|
}
|
|
await Bun.write(HYDRATION_DST_DIR_MAP_JSON_FILE, JSON.stringify(artifacts_map, null, 4));
|
|
}
|