DenoDDeno
Powered by
cathalogradyC
Denoβ€’16mo 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
svelte
.

The idea was to mark it as external in the esbuild build and then just copy the dependency into the
dist/
dist/
folder, see my
build.ts
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(),
    }),
  ],
})
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(),
    }),
  ],
})
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dependency injection deno deploy
fro.profesionalFfro.profesional / help
3y ago
Clean Integration of a Multi-file Deno Project as a Dependency in another Deno Project
ShehriyarSShehriyar / help
13mo ago
does/will Deno support local font access api?
apzAapz / help
2y ago
Deno+vite crashes on node dependency
DanielduelDDanielduel / help
3y ago