Skip to content

Commit

Permalink
chore: adjust Deno polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Dec 11, 2024
1 parent a7d6fb0 commit 17ea351
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/polyfills/deno.mts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import process from 'node:process';
import { env, exit, cwd } from 'node:process';
import { createRequire } from 'node:module';
import { resolve, normalize } from 'node:path';

const file = process.env?.FILE;
if (!file) {
process.exit(1);
}
const file = env?.POKU_FILE;
if (!file) exit(1);

const cwd = process.cwd();
const targetPath = resolve(cwd, '');
const targetPath = resolve(cwd(), '');
const filePath = resolve(targetPath, file!);

globalThis.require = createRequire(targetPath);
Expand Down

0 comments on commit 17ea351

Please sign in to comment.