deno_emit
deno_emit copied to clipboard
Unable to output during bundling: load_transformed failed: failed to analyze module: failed to resolve node:fs
Hi, it seems like deno_emit fails to handle node:*
specifiers.
Here is a repro:
// main.ts
import * as fs from 'node:fs';
fs.writeFileSync('message.txt', 'Hello world!');
// _bundler.ts
import { bundle } from 'jsr:@deno/emit';
const [mod] = Deno.args;
const { code } = await bundle(mod);
const bytes = new TextEncoder().encode(code);
const location = import.meta.resolve(mod).replace(/\.ts$/, '.js');
Deno.writeFileSync(location, bytes);
Execute it with: deno run -A _bundler.ts main.ts