deno_emit
deno_emit copied to clipboard
Transpile and bundle JavaScript and TypeScript under Deno and Deno Deploy
Currently the compiler options are ignored (or not available). They need to be passed to Rust and affect the emit just like with CLI.
Partially fix #29 but is not fully complete. It adds the ability to pass CompilerOptions object to Rust, so it is possible to toggle sourceMap/InlineSourceMap ```ts BundleOptions { ... compilerOptions:...
```js import {emit} from "https://deno.land/x/[email protected]/mod.ts"; await emit("https://deno.land/[email protected]/path/mod.ts") ``` gives ``` Uncaught Error: Module not found "file:///Users/Jesper/https:/deno.land/[email protected]/path/mod.ts". at __wbg_new_651776e932b7e9c7 (https://deno.land/x/[email protected]/lib/emit.generated.js:329:19) at (https://deno.land/x/[email protected]/lib/emit_bg.wasm:1:7194705) at (https://deno.land/x/[email protected]/lib/emit_bg.wasm:1:2500606) at (https://deno.land/x/[email protected]/lib/emit_bg.wasm:1:6371297) at (https://deno.land/x/[email protected]/lib/emit_bg.wasm:1:7147137) at __wbg_adapter_16 (https://deno.land/x/[email protected]/lib/emit.generated.js:205:6)...
Do you have any examples about migrating from `importMap`/`importMapPath` to `imports` ? Consider the following ```ts const {files} = await Deno.emit(`data:application/javascript;base64,${encode(typescript)}`, { bundle: "classic", importMapPath: "imports.json", importMap: {imports: {"@project/": "/my/custom/path/"}},...
Bundler Code: ```ts const url = new URL("./src/main/main.ts", import.meta.url); const emited = await bundle(url.href); await Deno.writeTextFile("./public/main.js", emited.code); ``` Code for Bundling: ```ts console.log("Test?") ``` Versions 0.0.1 and 0.0.2 output bundles....
What's the roadmap for adding the other APIs which were [removed in Deno v`1.22.0`](https://deno.com/blog/v1.22#removal-of-unstable-denoemit-denoformatdiagnostics-and-denoapplysourcemap-apis)? - Programmatic type-checking - [`Deno.formatDiagnostics`](https://doc.deno.land/deno/[email protected]/~/Deno.formatDiagnostics) - [`Deno.applySourceMap`](https://doc.deno.land/deno/[email protected]/~/Deno.applySourceMap) It feels like an oversight that all of it...
I'm experimenting with running the wasm in a constrained environment, and it's very close to fitting, just need a small (~3 to 5%) reduction in the size of the wasm....
I saw in the README that this module does no typechecking during its bundling process. I would like to do the typechecking prior to bundling, and I do not want...
It looks like, when you provide sources to `Deno.emit`, specifiers that don't have a file extension break something. Consider the following example: ```js await Deno.emit('file:///index.js', { bundle: 'module', importMapPath: new...
> Found by john.spurlock on Discord Trying to bundle files through `Deno.emit` that import JSON Modules via import assertions fails. However, the expected behavior should be for the JSON imports...