Access project dependency through Deno API
Maybe I am solving the wrong problem here, but I want to copy a deno dependency into my esbuild bundle so that it can be accesable on the web. The specific dependency I want is
svelte
.
The idea was to mark it as external in the esbuild build and then just copy the dependency into the dist/
folder, see my build.ts
file here:
4 Replies
Can you specify which issue are incurring in?
Is your project a Deno project? If so, esbuild won't be capable to resolve and load your imports.
that is exactly the issue I am having with just a native deno project (only
deno.json
)yeah that's because esbuild is tailored for node projects, but fortunately esbuild supports plugin to extend its functionalities, try using this plugin:
https://github.com/lucacasonato/esbuild_deno_loader/
Also I've made a rewrite of that plugin, I'd be glad if you tried it out:
https://github.com/twosaturdayscode/esbuild-deno-plugin
let me know if you are stuck
ill try that out ! thanks
(tomorrow)