cathalogradyC
Denoβ€’15mo agoβ€’
7 replies
cathalogrady

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:

import esbuild from "esbuild"
import sveltePlugin from "esbuild-svelte"
import { sveltePreprocess } from "svelte-preprocess"

esbuild.build({
  entryPoints: ["main.ts"],
  // external: ["svelte"],
  platform: "browser",
  format: "esm",
  outdir: "dist/",
  bundle: true,
  minify: false,
  sourcemap: true,
  plugins: [
    sveltePlugin({
      preprocess: sveltePreprocess(),
    }),
  ],
})
Was this page helpful?