Skip to content

Commit 4377108

Browse files
committed
Always use ESM version of YAML
We were using the url `https://esm.sh/yaml@2.2.1` as the yaml module, however, it appears that `esm.sh` detects the user agent that is downloading and serves different versions of the assets based on it, so in this case, it was actually getting a special Deno bundle of the `yaml` package that included a bunch of Deno/NodeJS shims. However, when we were bundling for the website, this is not appropriate at all, which is why it was receiving a `ReferenceError: Deno is undefined` You can tell `esm.sh` the target of your platform directly by setting the `target`. This results in a much smaller dependency set, and one that works in the browser. We don't use the file system at all, so there is no need to use anything but the ESM build of `yaml`
1 parent 4b011ea commit 4377108

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

deps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export { default as yaml } from "https://esm.sh/yaml@2.2.1";
2-
export type { ParsedNode as YAMLParsedNode } from "https://esm.sh/yaml@2.2.1";
1+
export * as yaml from "https://esm.sh/yaml@2.2.1?target=es2022";
2+
export type { ParsedNode as YAMLParsedNode } from "https://esm.sh/yaml@2.2.1?target=es2022";
33
export * from "https://raw.githubusercontent.com/cowboyd/instructional-effection/v0.0.0/mod.ts";
44
export { resolve } from "https://deno.land/std@0.163.0/path/posix.ts";
55
export type {

www/deno.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)