feat: limited npm: specifier support (#1245)

This commit adds limited support for `npm:` specifiers. Right now,
`npm:` specifiers are unsupported on Deno Deploy.

Towards #978
This commit is contained in:
Luca Casonato
2023-06-06 17:41:29 +02:00
committed by GitHub
parent dd4e584a3e
commit bb48f7b8eb
10 changed files with 95 additions and 7 deletions
+4 -4
View File
@@ -7,14 +7,14 @@ export { escape as regexpEscape } from "https://deno.land/std@0.190.0/regexp/esc
// -- esbuild --
// @deno-types="https://deno.land/x/esbuild@v0.17.11/mod.d.ts"
import * as esbuildWasm from "https://deno.land/x/esbuild@v0.17.11/wasm.js";
import * as esbuildNative from "https://deno.land/x/esbuild@v0.17.11/mod.js";
import * as esbuildWasm from "https://deno.land/x/esbuild@v0.17.19/wasm.js";
import * as esbuildNative from "https://deno.land/x/esbuild@v0.17.19/mod.js";
// @ts-ignore trust me
// deno-lint-ignore no-deprecated-deno-api
const esbuild: typeof esbuildWasm = Deno.run === undefined
? esbuildWasm
: esbuildNative;
const esbuildWasmURL = new URL("./esbuild_v0.17.11.wasm", import.meta.url).href;
const esbuildWasmURL = new URL("./esbuild_v0.17.19.wasm", import.meta.url).href;
export { esbuild, esbuildWasm as esbuildTypes, esbuildWasmURL };
export { denoPlugins } from "https://deno.land/x/esbuild_deno_loader@0.7.2/mod.ts";
export { denoPlugins } from "https://deno.land/x/esbuild_deno_loader@0.8.1/mod.ts";
+1 -1
View File
@@ -54,7 +54,7 @@ export class EsbuildBuilder implements Builder {
const bundle = await esbuild.build({
entryPoints: opts.entrypoints,
platform: "neutral",
platform: "browser",
target: ["chrome99", "firefox99", "safari15"],
format: "esm",