Skip to content

Commit

Permalink
Add Deno instructions to docs (#4311)
Browse files Browse the repository at this point in the history
* Add Deno instructions to docs

Fixes #4310

* Fix typo

* Format

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
  • Loading branch information
jespertheend and lukastaegert committed Dec 23, 2021
1 parent 473568c commit 84d2382
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/07-tools.md
Expand Up @@ -246,3 +246,25 @@ 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";

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()`.

0 comments on commit 84d2382

Please sign in to comment.