A plugin for esbuild to support Deno-style resolution and loading
by denolandTypeScript
Last 12 weeks · 0 commits
2 of 6 standards met
when using esbuild within node, the paths you find in comments and within functions usually start like: but when migrating to deno & esbuild with this plugin, its providing the absolute path like: this leads to the output being different across systems due to the username and also os-specific nature of an absolute path. ive tried many options in esbuild to mitigate this and the only method that works is to fully minify to obscure the comments and entries. otherwise it shows up like this: heres that same import but back when i was using node: would it be possible to fake these paths to esbuild in some way to make this consistent across platforms and also prevent this mini leakage? my esbuild config if its of any use:
I tried to embed the CSS as plain text within a script file. However, when using Raw Import to load a CSS file with , the contents of the CSS file are still being parsed for things like . In other words, even though I intend to load the file purely as text, module resolution is still taking place. In contrast, when I kept the contents the same but changed the file extension to , no module resolution occurred. Is this behavior intentional?
When using a more recent minor version of ESBuild than is specified in results in a that contains two versions of . For example… If you then add an import from and into and run , you'll see that has two versions of . Despite the fact that depends on , dependencies in are written with because is treated differently. This means that using with this plugin installs two versions of ESBuild. ESBuild does not plan to move to version 1 as far as I know (it's been discussed quite a bit). So for the time being, I've included this plugin in my source tree to prevent doubling up . I'm not sure what a good solution is here other than to maybe rely on without a version to work around it. 🤷 Regardless, I thought I should raise the issue. Thanks for taking a look!
On the latest version of Deno, a tes tappears to be failing. I'm not sure if it's caused by there being a newer patch version of the @deno/loader or a newer version of Deno. The error message is . I ran into this issue while working on fixing a different issue. Here is the output from running tests.
Repository: denoland/deno-esbuild-plugin. Description: A plugin for esbuild to support Deno-style resolution and loading Stars: 15, Forks: 1. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Latest release: 1.2.1 (8mo ago). Open PRs: 1, open issues: 7. Last activity: 8mo ago. Community health: 37%. Top contributors: marvinhagemeister, csvn.