diff --git a/src/docs/javascript-runtime.webc b/src/docs/javascript-runtime.webc index e599524fe7..cc7a885742 100644 --- a/src/docs/javascript-runtime.webc +++ b/src/docs/javascript-runtime.webc @@ -37,6 +37,35 @@ const eleventyNavigation = { deno --allow-all npm:@11ty/eleventy deno --allow-all npm:@11ty/eleventy --serve + +# Or use stricter permissions +deno --allow-env --allow-sys=homedir --allow-read=./ --allow-write=_site/ npm:@11ty/eleventy +deno --allow-env --allow-sys=homedir --allow-read=./ --allow-write=_site/ npm:@11ty/eleventy --serve + + +

Alternatively, you can use deno.json to configure permissions:

+ +// deno.json +{ + "$schema": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json", + "permissions": { + "default": { + "env": true, + "sys": [ "homedir" ], + "read": [ "./" ], + "write": [ "_site/" ] + } + } +} +// Eleventy requires package.json to be readable, as well as node_modules when using serve + +// package.json +{ + "scripts": { + "build": "deno -P npm:@11ty/eleventy", + "serve": "deno -P --allow-net=0.0.0.0:8080 npm:@11ty/eleventy --serve" + } +}

Read about our plans to move away from --allow-all on #3278.