Skip to content

Commit 6eaecf3

Browse files
committedJun 21, 2021
Fix docs typos
1 parent 115e143 commit 6eaecf3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎docs/01-command-line-reference.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
};
1919
```
2020

21-
Typically, it is called `rollup.config.js` and sits in the root directory of your project. Behind the scenes, Rollup will transpile and bundle this file and its relative dependencies to CommonJS before requiring it, which has the advantage that you can share code with an ES module code base while having full interoperability with the Node ecosystem.
21+
Typically, it is called `rollup.config.js` and sits in the root directory of your project. Behind the scenes, Rollup will usually transpile and bundle this file and its relative dependencies to CommonJS before requiring it. This has the advantage that you can share code with an ES module code base while having full interoperability with the Node ecosystem.
2222

2323
If you want to write your config as a CommonJS module using `require` and `module.exports`, you should change the file extension to `.cjs`, which will prevent Rollup from trying to transpile the file. Furthermore if you are on Node 13+, changing the file extension to `.mjs` will also prevent Rollup from transpiling it but import the file as an ES module instead. See [using untranspiled config files](guide/en/#using-untranspiled-config-files) for more details and why you might want to do this.
2424

@@ -119,7 +119,7 @@ export default { // can be an array (for multiple inputs)
119119
};
120120
```
121121

122-
You can export an **array** from your config file to build bundles from several different unrelated inputs at once, even in watch mode. To build different bundles with the same input, you supply an array of output options for each input:
122+
You can export an **array** from your config file to build bundles from several unrelated inputs at once, even in watch mode. To build different bundles with the same input, you supply an array of output options for each input:
123123

124124
```javascript
125125
// rollup.config.js (building more than one bundle)
@@ -245,7 +245,7 @@ You can also directly write your config in TypeScript via the [`--configPlugin`]
245245

246246
### Differences to the JavaScript API
247247

248-
While config files provide an easy way to configure Rollup, they also limit how Rollup can be invoked and where configuration is taken from. Especially if you are rebundling Rollup in another build tool or want to integrate it into an advanced build process, it may be better to directly invoke Rollup programmatically from your scripts.
248+
While config files provide an easy way to configure Rollup, they also limit how Rollup can be invoked and configured. Especially if you are bundling Rollup into another build tool or want to integrate it into an advanced build process, it may be better to directly invoke Rollup programmatically from your scripts.
249249

250250
If you want to switch from config files to using the [JavaScript API](guide/en/#javascript-api) at some point, there are some important differences to be aware of:
251251

@@ -280,7 +280,7 @@ module.exports = {
280280

281281
It may be pertinent if you want to use the config file not only from the command line, but also from your custom scripts programmatically.
282282

283-
On the other hand if you are using at least Node 13 and have `"type": "module"` in your `package.json` file, Rollup's transpilation will prevent your configuration file from importing packages that are themselves ES modules. In that case, changing your file extension to `.mjs` will instruct Rollup to import your configuration directly as an ES module. However note that this is specific to Node 13+; on older Node versions, `.mjs` is treated just like `.js`.
283+
On the other hand if you are using at least Node 13 and have `"type": "module"` in your `package.json` file, Rollup's transpilation will prevent your configuration file from importing packages that are themselves ES modules. In that case, changing your file extension to `.mjs` will instruct Rollup to import your configuration directly as an ES module. However, note that this is specific to Node 13+; on older Node versions, `.mjs` is treated just like `.js`.
284284

285285
There are some potential gotchas when using `.mjs` on Node 13+:
286286

@@ -420,21 +420,21 @@ If you want to load more than one plugin, you can repeat the option or supply a
420420
rollup -i input.js -f es -p node-resolve -p commonjs,json
421421
```
422422

423-
By default, plugin functions be called with no argument to create the plugin. You can however pass a custom argument as well:
423+
By default, plugin functions will be called with no argument to create the plugin. You can however pass a custom argument as well:
424424

425425
```
426426
rollup -i input.js -f es -p 'terser={output: {beautify: true, indent_level: 2}}'
427427
```
428428

429429
#### `--configPlugin <plugin>`
430430

431-
Allows to specify Rollup plugins to transpile or otherwise control the parsing of your configuration file. The main benefit is that it allows you to use non-JavaScript configuration files. For instance the following will allow you to write your configuration in TypeScript, provided you have `@rollup/plugin-typescript` installed:
431+
Allows specifying Rollup plugins to transpile or otherwise control the parsing of your configuration file. The main benefit is that it allows you to use non-JavaScript configuration files. For instance the following will allow you to write your configuration in TypeScript, provided you have `@rollup/plugin-typescript` installed:
432432

433433
```
434434
rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
435435
```
436436

437-
It supports the same syntax as the [`--plugin`](guide/en/#-p-plugin---plugin-plugin) option i.e. you can specify the option multiple times, you can omit the `@rollup/plugin-` prefix and just write `typescript` and you can specify plugin options via `={...}`.
437+
It supports the same syntax as the [`--plugin`](guide/en/#-p-plugin---plugin-plugin) option i.e., you can specify the option multiple times, you can omit the `@rollup/plugin-` prefix and just write `typescript` and you can specify plugin options via `={...}`.
438438

439439
#### `-v`/`--version`
440440

@@ -501,7 +501,7 @@ When using the command line interface, Rollup can also read content from stdin:
501501
echo "export const foo = 42;" | rollup --format cjs --file out.js
502502
```
503503

504-
When this file contains imports, Rollup will try to resolve them relative to the current working directory. When a config file is used, Rollup will only use `stdin` as an entry point if the file name of the entry point is `-`. To read a non-entry-point file from stdin, just call it `-`, which is the file name that is used internally to reference `stdin`. I.e.
504+
When this file contains imports, Rollup will try to resolve them relative to the current working directory. When using a config file, Rollup will only use `stdin` as an entry point if the file name of the entry point is `-`. To read a non-entry-point file from stdin, just call it `-`, which is the file name that is used internally to reference `stdin`. I.e.
505505

506506
```js
507507
import foo from "-";

0 commit comments

Comments
 (0)
Please sign in to comment.