Skip to content

Commit

Permalink
Use Deno's native JSON importing
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Nov 23, 2024
1 parent 46be6c3 commit 0d39088
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
11 changes: 4 additions & 7 deletions packages/browser/build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions packages/server/build_npm.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
6 changes: 3 additions & 3 deletions packages/types/build_npm.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down

0 comments on commit 0d39088

Please sign in to comment.