- Notifications
You must be signed in to change notification settings - Fork5.6k
Description
Little context as preface: I'm trying out some polyfilling tricks to serve modules from jsdelivr/jspm with std/node and type declarations loaded in the background. The URLs below are from a dev instance of that project and code can be checkedhere
Given the following dependencyhttps://cdn-dev.dreg.dev/package/picomatch@2.2.2
, which gets loaded with type declarations with ax-typescript-types
, plainly runningdeno cache https://cdn-dev.dreg.dev/package/picomatch@2.2.2
will error unless you also add--no-check
. The same is true for a script that uses this dependency:
importpicomatchfrom"https://cdn-dev.dreg.dev/package/picomatch@2.2.2";constisMatch=picomatch("*.js");console.log(picomatch.test("foo/bar",/^(?:([^/]*?)\/([^/]*?))$/));console.log(isMatch("abcd"));//=> falseconsole.log(isMatch("a.js"));//=> trueconsole.log(isMatch("a.md"));//=> falseconsole.log(isMatch("a/b.js"));//=> false
Runningdeno cache --no-check
runs as expected and also stores the type hints, so consecutive runs ofdeno run
do not need the no-check flag and actually respect the type declarations.
In the case of (also) adding a--reload
flag: this doesnot work withdeno cache
butdoes withdeno run
so I'm a little confused.