Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #5382

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ export default {
If you want to convert a set of files to another format while maintaining the file structure and export signatures, the recommended way—instead of using [`output.preserveModules`](#output-preservemodules) that may tree-shake exports as well as emit virtual files created by plugins—is to turn every file into an entry point. You can do so dynamically e.g. via the `glob` package:

```js
import glob from 'glob';
import { globSync } from 'glob';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

export default {
input: Object.fromEntries(
glob.sync('src/**/*.js').map(file => [
globSync('src/**/*.js').map(file => [
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
path.relative(
Expand Down
10 changes: 4 additions & 6 deletions docs/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,17 @@ gulp.task('build', async function () {
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";
import { rollup } from "https://esm.sh/@rollup/browser";

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):
But it is not suitable for complex compiling. Alternatively you can install rollup from npm:

```js
import {createRequire} from "https://deno.land/std@0.110.0/node/module.ts";
const require = createRequire(import.meta.url);
const {rollup} = require("rollup");
import { rollup } from "npm: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()`.
Notice: Deno will request some permissions when running Rollup.