cathalogrady
cathalogrady
DDeno
Created by cathalogrady on 11/15/2024 in #help
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(),
}),
],
})
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(),
}),
],
})
8 replies