diff --git a/packages/browser/build_npm.ts b/packages/browser/build_npm.ts index 24810e8f..067d38b2 100644 --- a/packages/browser/build_npm.ts +++ b/packages/browser/build_npm.ts @@ -6,14 +6,11 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'; import { getBabelOutputPlugin } from '@rollup/plugin-babel'; import replace from '@rollup/plugin-replace'; -const outDir = './npm'; +import denoJSON from './deno.json' with { type: 'json' }; +import typesDenoJSON from '../types/deno.json' with { type: 'json' }; + -const denoJSON: { version: string } = JSON.parse( - Deno.readTextFileSync('./deno.jsonc'), -); -const typesDenoJSON: { version: string } = JSON.parse( - Deno.readTextFileSync('../types/deno.jsonc'), -); +const outDir = './npm'; /** * Generate ESM and CJS builds using Deno to Node Transform (dnt) diff --git a/packages/server/build_npm.ts b/packages/server/build_npm.ts index 57b064af..edecaae2 100644 --- a/packages/server/build_npm.ts +++ b/packages/server/build_npm.ts @@ -1,13 +1,10 @@ import { build, emptyDir } from '@deno/dnt'; -const outDir = './npm'; +import denoJSON from './deno.json' with { type: 'json' }; +import typesDenoJSON from '../types/deno.json' with { type: 'json' }; + -const denoJSON: { version: string } = JSON.parse( - Deno.readTextFileSync('./deno.jsonc'), -); -const typesDenoJSON: { version: string } = JSON.parse( - Deno.readTextFileSync('../types/deno.jsonc'), -); +const outDir = './npm'; await emptyDir(outDir); diff --git a/packages/types/build_npm.ts b/packages/types/build_npm.ts index efbf0c9a..909b8c10 100644 --- a/packages/types/build_npm.ts +++ b/packages/types/build_npm.ts @@ -1,9 +1,9 @@ import { build, emptyDir } from '@deno/dnt'; +import denoJSON from './deno.json' with { type: 'json' }; + + const outDir = './npm'; -const denoJSON: { version: string } = JSON.parse( - Deno.readTextFileSync('./deno.jsonc'), -); await emptyDir(outDir);