Skip to content

Commit c7972ce

Browse files
authored
Merge pull request #92 from taras/fix/dnt-isolated-manifest
fix(publish): keep manifest fields in the isolated build's deno.json
2 parents ef5dde6 + 1c56f55 commit c7972ce

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎scripts/build-npm.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,21 @@ await main(function* (args) {
165165
isolatedImports[name] = `npm:${name}@^${siblingVer}`;
166166
isolatedImports[`${name}/`] = `npm:${name}@^${siblingVer}/`;
167167
}
168+
// Preserve the manifest fields alongside the rewritten imports: cli/src/cli.ts
169+
// imports its own deno.json for `version`, so replacing the copy with a bare
170+
// import map makes that property vanish from the JSON module's type.
168171
yield* writeTextFile(
169172
join(srcCopy, "deno.json"),
170-
JSON.stringify({ imports: isolatedImports }, null, 2),
173+
JSON.stringify(
174+
{
175+
name: denoJson.name,
176+
version: denoJson.version,
177+
exports: denoJson.exports,
178+
imports: isolatedImports,
179+
},
180+
null,
181+
2,
182+
),
171183
);
172184

173185
try {

0 commit comments

Comments
 (0)