From 1f6ba69b0dc23f67eac762ad2b912f8e853e45f1 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Tue, 21 Dec 2021 16:32:17 +0100 Subject: [PATCH 1/3] Add Deno instructions to docs Fixes #4310 --- docs/07-tools.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/07-tools.md b/docs/07-tools.md index 20e545832cd..f3426f700d1 100755 --- a/docs/07-tools.md +++ b/docs/07-tools.md @@ -246,3 +246,22 @@ gulp.task('build', async function () { }); }); ``` + +### Deno +If you like to run Rollup in you can use [esm.sh](https://esm.sh/) like so: +```js +import {rollup} from "https://esm.sh/rollup@2.61.1"; + +const bundle = await rollup({ //... +``` + +Alternatively you can install rollup from npm and use the [node compatibility layer](https://deno.land/std@0.110.0/node): +```js +import {createRequire} from "https://deno.land/std@0.110.0/node/module.ts"; +const require = createRequire(import.meta.url); +const {rollup} = require("rollup"); + +const bundle = await rollup({ //... +``` + +Be sure to run deno with the `--unstable` flag. And don't forget `--allow-read` and `--allow-write` if you plan on using `bundle.write()`. From ea97b12e6a0add2edf5e35d2774c16a21581402d Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 22 Dec 2021 20:43:30 +0100 Subject: [PATCH 2/3] Fix typo --- docs/07-tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/07-tools.md b/docs/07-tools.md index f3426f700d1..60d74063dd4 100755 --- a/docs/07-tools.md +++ b/docs/07-tools.md @@ -248,7 +248,7 @@ gulp.task('build', async function () { ``` ### Deno -If you like to run Rollup in you can use [esm.sh](https://esm.sh/) like so: +If you like to run Rollup in Deno you can use [esm.sh](https://esm.sh/) like so: ```js import {rollup} from "https://esm.sh/rollup@2.61.1"; From 0b092b7497869ecfc10d121223866fc65cbce867 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 22 Dec 2021 20:44:35 +0100 Subject: [PATCH 3/3] Format --- docs/07-tools.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/07-tools.md b/docs/07-tools.md index 60d74063dd4..0c3c9c3360c 100755 --- a/docs/07-tools.md +++ b/docs/07-tools.md @@ -248,7 +248,9 @@ gulp.task('build', async function () { ``` ### Deno + If you like to run Rollup in Deno you can use [esm.sh](https://esm.sh/) like so: + ```js import {rollup} from "https://esm.sh/rollup@2.61.1"; @@ -256,6 +258,7 @@ const bundle = await rollup({ //... ``` Alternatively you can install rollup from npm and use the [node compatibility layer](https://deno.land/std@0.110.0/node): + ```js import {createRequire} from "https://deno.land/std@0.110.0/node/module.ts"; const require = createRequire(import.meta.url);