Skip to content

Commit 928d7d6

Browse files
committed
Update website links
1 parent 0dd6c15 commit 928d7d6

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

docs/02-javascript-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function build() {
6666
build();
6767
```
6868

69-
#### inputOptions
69+
#### inputOptions object
7070

7171
The `inputOptions` object can contain the following properties (see the [big list of options](guide/en#big-list-of-options) for full details on these):
7272

@@ -103,7 +103,7 @@ const inputOptions = {
103103
};
104104
```
105105

106-
#### outputOptions
106+
#### outputOptions object
107107

108108
The `outputOptions` object can contain the following properties (see the [big list of options](guide/en#big-list-of-options) for full details on these):
109109

docs/04-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Rollup will use the dynamic import to create a separate chunk that is only loade
215215
rollup src/main.js -f cjs -d dist
216216
```
217217

218-
This will create a folder `dist` containing two files, `main.js` and `chunk-[hash].js`, where `[hash]` is a content based hash string. You can supply your own naming patterns by specifying the [`output.chunkFileNames`](guide/en#output-chunkfilenames) and [`output.entryFileNames`](guide/en#output-entryfilenames) options.
218+
This will create a folder `dist` containing two files, `main.js` and `chunk-[hash].js`, where `[hash]` is a content based hash string. You can supply your own naming patterns by specifying the [`output.chunkFileNames`](guide/en#outputchunkfilenames) and [`output.entryFileNames`](guide/en#outputentryfilenames) options.
219219

220220
You can still run your code as before with the same output, albeit a little slower as loading and parsing of `./foo.js` will only commence once we call the exported function for the first time.
221221

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Plugins
2+
title: Plugin Development
33
---
44

55
### Plugins Overview
@@ -76,7 +76,7 @@ In addition to properties defining the identity of your plugin, you may also spe
7676
Type: `string | (() => string)`<br>
7777
Kind: `async, parallel`
7878

79-
Cf. [`output.banner/output.footer`](guide/en#output-banner-output-footer).
79+
Cf. [`output.banner/output.footer`](guide/en#outputbanneroutputfooter).
8080

8181
#### `buildEnd`
8282
Type: `(error?: Error) => void`<br>
@@ -94,7 +94,7 @@ Called on each `rollup.rollup` build.
9494
Type: `string | (() => string)`<br>
9595
Kind: `async, parallel`
9696

97-
Cf. [`output.banner/output.footer`](guide/en#output-banner-output-footer).
97+
Cf. [`output.banner/output.footer`](guide/en#outputbanneroutputfooter).
9898

9999
#### `generateBundle`
100100
Type: `(options: OutputOptions, bundle: { [fileName: string]: AssetInfo | ChunkInfo }, isWrite: boolean) => void`<br>
@@ -137,7 +137,7 @@ Called at the end of `bundle.generate()` or immediately before the files are wri
137137
Type: `string | (() => string)`<br>
138138
Kind: `async, parallel`
139139

140-
Cf. [`output.intro/output.outro`](guide/en#output-intro-output-outro).
140+
Cf. [`output.intro/output.outro`](guide/en#outputintrooutputoutro).
141141

142142
#### `load`
143143
Type: `(id: string) => string | null | { code: string, map?: string | SourceMap, ast? : ESTree.Program, moduleSideEffects?: boolean | null }`<br>
@@ -147,7 +147,7 @@ Defines a custom loader. Returning `null` defers to other `load` functions (and
147147

148148
If `false` is returned for `moduleSideEffects` and no other module imports anything from this module, then this module will not be included in the bundle without checking for actual side-effects inside the module. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side-effects (such as modifying a global or exported variable). If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the first `resolveId` hook that resolved this module, the `treeshake.moduleSideEffects` option, or eventually default to `true`. The `transform` hook can override this.
149149

150-
You can use [`this.getModuleInfo`](guide/en#this-getmoduleinfo-moduleid-string-moduleinfo) to find out the previous value of `moduleSideEffects` inside this hook.
150+
You can use [`this.getModuleInfo`](guide/en#thisgetmoduleinfomoduleid-string--moduleinfo) to find out the previous value of `moduleSideEffects` inside this hook.
151151

152152
#### `options`
153153
Type: `(options: InputOptions) => InputOptions | null`<br>
@@ -165,7 +165,7 @@ Reads and replaces or manipulates the output options object passed to `bundle.ge
165165
Type: `string | (() => string)`<br>
166166
Kind: `async, parallel`
167167

168-
Cf. [`output.intro/output.outro`](guide/en#output-intro-output-outro).
168+
Cf. [`output.intro/output.outro`](guide/en#outputintrooutputoutro).
169169

170170
#### `renderChunk`
171171
Type: `(code: string, chunk: ChunkInfo, options: OutputOptions) => string | { code: string, map: SourceMap } | null`<br>
@@ -198,7 +198,7 @@ In case a dynamic import is not passed a string as argument, this hook gets acce
198198
- If a string is returned, this string is *not* interpreted as a module id but is instead used as a replacement for the import argument. It is the responsibility of the plugin to make sure the generated code is valid.
199199
- To resolve such an import to an existing module, you can still return an object `{id, external}`.
200200

201-
Note that the return value of this hook will not be passed to `resolveId` afterwards; if you need access to the static resolution algorithm, you can use [`this.resolve(source, importer)`](guide/en#this-resolve-source-string-importer-string-promise-id-string-external-boolean-null) on the plugin context.
201+
Note that the return value of this hook will not be passed to `resolveId` afterwards; if you need access to the static resolution algorithm, you can use [`this.resolve(source, importer)`](guide/en#thisresolvesource-string-importer-string-options-skipself-boolean--promiseid-string-external-boolean--null) on the plugin context.
202202

203203
#### `resolveFileUrl`
204204
Type: `({assetReferenceId: string | null, chunkId: string, chunkReferenceId: string | null, fileName: string, format: string, moduleId: string, relativePath: string}) => string | null`<br>
@@ -280,7 +280,7 @@ Note that in watch mode, the result of this hook is cached when rebuilding and t
280280

281281
If `false` is returned for `moduleSideEffects` and no other module imports anything from this module, then this module will not be included without checking for actual side-effects inside the module. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side-effects (such as modifying a global or exported variable). If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the first `resolveId` hook that resolved this module, the `treeshake.moduleSideEffects` option, or eventually default to `true`.
282282

283-
You can use [`this.getModuleInfo`](guide/en#this-getmoduleinfo-moduleid-string-moduleinfo) to find out the previous value of `moduleSideEffects` inside this hook.
283+
You can use [`this.getModuleInfo`](guide/en#thisgetmoduleinfomoduleid-string--moduleinfo) to find out the previous value of `moduleSideEffects` inside this hook.
284284

285285
#### `watchChange`
286286
Type: `(id: string) => void`<br>
@@ -329,19 +329,19 @@ In general, it is recommended to use `this.addWatchfile` from within the hook th
329329

330330
#### `this.emitAsset(assetName: string, source: string) => string`
331331

332-
Emits a custom file that is included in the build output, returning an `assetReferenceId` that can be used to reference the emitted file. You can defer setting the source if you provide it later via [`this.setAssetSource(assetReferenceId, source)`](guide/en#this-setassetsource-assetreferenceid-string-source-string-buffer-void). A string or Buffer source must be set for each asset through either method or an error will be thrown on generate completion.
332+
Emits a custom file that is included in the build output, returning an `assetReferenceId` that can be used to reference the emitted file. You can defer setting the source if you provide it later via [`this.setAssetSource(assetReferenceId, source)`](guide/en#thissetassetsourceassetreferenceid-string-source-string--buffer--void). A string or Buffer source must be set for each asset through either method or an error will be thrown on generate completion.
333333

334-
Emitted assets will follow the [`output.assetFileNames`](guide/en#output-assetfilenames) naming scheme. You can reference the URL of the file in any code returned by a [`load`](guide/en#load) or [`transform`](guide/en#transform) plugin hook via `import.meta.ROLLUP_ASSET_URL_assetReferenceId`. See [Asset URLs](guide/en#asset-urls) for more details and an example.
334+
Emitted assets will follow the [`output.assetFileNames`](guide/en#outputassetfilenames) naming scheme. You can reference the URL of the file in any code returned by a [`load`](guide/en#load) or [`transform`](guide/en#transform) plugin hook via `import.meta.ROLLUP_ASSET_URL_assetReferenceId`. See [Asset URLs](guide/en#asset-urls) for more details and an example.
335335

336-
The generated code that replaces `import.meta.ROLLUP_ASSET_URL_assetReferenceId` can be customized via the [`resolveFileUrl`](guide/en#resolvefileurl) plugin hook. Once the asset has been finalized during `generate`, you can also use [`this.getAssetFileName(assetReferenceId)`](guide/en#this-getassetfilename-assetreferenceid-string-string) to determine the file name.
336+
The generated code that replaces `import.meta.ROLLUP_ASSET_URL_assetReferenceId` can be customized via the [`resolveFileUrl`](guide/en#resolvefileurl) plugin hook. Once the asset has been finalized during `generate`, you can also use [`this.getAssetFileName(assetReferenceId)`](guide/en#thisgetassetfilenameassetreferenceid-string--string) to determine the file name.
337337

338338
#### `this.emitChunk(moduleId: string, options?: {name?: string}) => string`
339339

340340
Emits a new chunk with the given module as entry point. This will not result in duplicate modules in the graph, instead if necessary, existing chunks will be split. It returns a `chunkReferenceId` that can be used to later access the generated file name of the chunk.
341341

342-
Emitted chunks will follow the [`output.chunkFileNames`](guide/en#output-chunkfilenames), [`output.entryFileNames`](guide/en#output-entryfilenames) naming scheme. If a `name` is provided, this will be used for the `[name]` file name placeholder, otherwise the name will be derived from the file name. If a `name` is provided, this name must not conflict with any other entry point names unless the entry points reference the same entry module. You can reference the URL of the emitted chunk in any code returned by a [`load`](guide/en#load) or [`transform`](guide/en#transform) plugin hook via `import.meta.ROLLUP_CHUNK_URL_chunkReferenceId`.
342+
Emitted chunks will follow the [`output.chunkFileNames`](guide/en#outputchunkfilenames), [`output.entryFileNames`](guide/en#outputentryfilenames) naming scheme. If a `name` is provided, this will be used for the `[name]` file name placeholder, otherwise the name will be derived from the file name. If a `name` is provided, this name must not conflict with any other entry point names unless the entry points reference the same entry module. You can reference the URL of the emitted chunk in any code returned by a [`load`](guide/en#load) or [`transform`](guide/en#transform) plugin hook via `import.meta.ROLLUP_CHUNK_URL_chunkReferenceId`.
343343

344-
The generated code that replaces `import.meta.ROLLUP_CHUNK_URL_chunkReferenceId` can be customized via the [`resolveFileUrl`](guide/en#resolvefileurl) plugin hook. Once the chunk has been rendered during `generate`, you can also use [`this.getChunkFileName(chunkReferenceId)`](guide/en#this-getchunkfilename-chunkreferenceid-string-string) to determine the file name.
344+
The generated code that replaces `import.meta.ROLLUP_CHUNK_URL_chunkReferenceId` can be customized via the [`resolveFileUrl`](guide/en#resolvefileurl) plugin hook. Once the chunk has been rendered during `generate`, you can also use [`this.getChunkFileName(chunkReferenceId)`](guide/en#thisgetchunkfilenamechunkreferenceid-string--string) to determine the file name.
345345

346346
#### `this.error(error: string | Error, position?: number) => void`
347347

@@ -418,9 +418,9 @@ The `position` argument is a character index where the warning was raised. If pr
418418

419419
☢️ These context utility functions have been deprecated and may be removed in a future Rollup version.
420420

421-
- `this.isExternal(id: string, importer: string, isResolved: boolean): boolean` - _**Use [`this.resolve`](guide/en#this-resolve-source-string-importer-string-promise-id-string-external-boolean-null)**_ - Determine if a given module ID is external when imported by `importer`. When `isResolved` is false, Rollup will try to resolve the id before testing if it is external.
421+
- `this.isExternal(id: string, importer: string, isResolved: boolean): boolean` - _**Use [`this.resolve`](guide/en#thisresolvesource-string-importer-string-options-skipself-boolean--promiseid-string-external-boolean--null)**_ - Determine if a given module ID is external when imported by `importer`. When `isResolved` is false, Rollup will try to resolve the id before testing if it is external.
422422

423-
- `this.resolveId(source: string, importer: string) => Promise<string | null>` - _**Use [`this.resolve`](guide/en#this-resolve-source-string-importer-string-promise-id-string-external-boolean-null)**_ - Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses. Returns `null` if an id cannot be resolved.
423+
- `this.resolveId(source: string, importer: string) => Promise<string | null>` - _**Use [`this.resolve`](guide/en#thisresolvesource-string-importer-string-options-skipself-boolean--promiseid-string-external-boolean--null)**_ - Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses. Returns `null` if an id cannot be resolved.
424424

425425
### Asset URLs
426426

docs/999-big-list-of-options.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The conversion back to a relative import is done as if `output.file` or `output.
6969
Type: `string | string [] | { [entryName: string]: string }`<br>
7070
CLI: `-i`/`--input <filename>`
7171

72-
The bundle's entry point(s) (e.g. your `main.js` or `app.js` or `index.js`). If you provide an array of entry points or an object mapping names to entry points, they will be bundled to separate output chunks. Unless the [`output.file`](guide/en#output-file) option is used, generated chunk names will follow the [`output.entryFileNames`](guide/en#output-entryfilenames) option. When using the object form, the `[name]` portion of the file name will be the name of the object property while for the array form, it will be the file name of the entry point.
72+
The bundle's entry point(s) (e.g. your `main.js` or `app.js` or `index.js`). If you provide an array of entry points or an object mapping names to entry points, they will be bundled to separate output chunks. Unless the [`output.file`](guide/en#outputfile) option is used, generated chunk names will follow the [`output.entryFileNames`](guide/en#outputentryfilenames) option. When using the object form, the `[name]` portion of the file name will be the name of the object property while for the array form, it will be the file name of the entry point.
7373

7474
Note that it is possible when using the object form to put entry points into different sub-folders by adding a `/` to the name. The following will generate at least two entry chunks with the names `entry-a.js` and `entry-b/index.js`, i.e. the file `index.js` is placed in the folder `entry-b`:
7575

@@ -229,7 +229,7 @@ this.a.b.c = ...
229229
#### plugins
230230
Type: `Plugin | (Plugin | void)[]`
231231

232-
See [Using plugins](guide/en#using-plugins) for more information on how to use plugins and [Plugins](guide/en#plugins) on how to write your own (try it out, it's not as difficult as it may sound and very much extends what you can do with Rollup!). For plugins imported from packages, remember to call the imported plugin function (i.e. `commonjs()`, not just `commonjs`). Falsy plugins will be ignored, which can be used to easily activate or deactivate plugins.
232+
See [Using plugins](guide/en#using-plugins) for more information on how to use plugins and [Plugins](guide/en#plugin-development) on how to write your own (try it out, it's not as difficult as it may sound and very much extends what you can do with Rollup!). For plugins imported from packages, remember to call the imported plugin function (i.e. `commonjs()`, not just `commonjs`). Falsy plugins will be ignored, which can be used to easily activate or deactivate plugins.
233233

234234
```js
235235
// rollup.config.js
@@ -367,7 +367,7 @@ The pattern to use for naming custom emitted assets to include in the build outp
367367
* `[hash]`: A hash based on the name and content of the asset.
368368
* `[name]`: The file name of the asset excluding any extension.
369369

370-
Forward slashes `/` can be used to place files in sub-directories. See also `[`output.chunkFileNames`](guide/en#output-chunkfilenames)`, [`output.entryFileNames`](guide/en#output-entryfilenames).
370+
Forward slashes `/` can be used to place files in sub-directories. See also `[`output.chunkFileNames`](guide/en#outputchunkfilenames)`, [`output.entryFileNames`](guide/en#outputentryfilenames).
371371

372372
#### output.banner/output.footer
373373
Type: `string | (() => string | Promise<string>)`<br>
@@ -387,7 +387,7 @@ export default {
387387
};
388388
```
389389

390-
See also [`output.intro/output.outro`](guide/en#output-intro-output-outro).
390+
See also [`output.intro/output.outro`](guide/en#outputintrooutputoutro).
391391

392392
#### output.chunkFileNames
393393
Type: `string`<br>
@@ -399,7 +399,7 @@ The pattern to use for naming shared chunks created when code-splitting. Pattern
399399
* `[hash]`: A hash based on the content of the chunk and the content of all its dependencies.
400400
* `[name]`: The name of the chunk. This will be `chunk` unless the chunk was created via the [`manualChunks`](guide/en#manualchunks) options.
401401

402-
Forward slashes `/` can be used to place files in sub-directories. See also [`output.assetFileNames`](guide/en#output-assetfilenames), [`output.entryFileNames`](guide/en#output-entryfilenames).
402+
Forward slashes `/` can be used to place files in sub-directories. See also [`output.assetFileNames`](guide/en#outputassetfilenames), [`output.entryFileNames`](guide/en#outputentryfilenames).
403403

404404
#### output.compact
405405
Type: `boolean`<br>
@@ -418,7 +418,7 @@ The pattern to use for chunks created from entry points. Pattern supports the fo
418418
* `[hash]`: A hash based on the content of the entry point and the content of all its dependencies.
419419
* `[name]`: The file name (without extension) of the entry point.
420420

421-
Forward slashes `/` can be used to place files in sub-directories. See also [`output.assetFileNames`](guide/en#output-assetfilenames), [`output.chunkFileNames`](guide/en#output-chunkfilenames).
421+
Forward slashes `/` can be used to place files in sub-directories. See also [`output.assetFileNames`](guide/en#outputassetfilenames), [`output.chunkFileNames`](guide/en#outputchunkfilenames).
422422

423423
#### output.extend
424424
Type: `boolean`<br>
@@ -438,7 +438,7 @@ Whether or not to add an 'interop block'. By default (`interop: true`), for safe
438438
Type: `string | (() => string | Promise<string>)`<br>
439439
CLI: `--intro`/`--outro <text>`
440440

441-
Similar to [`output.banner/output.footer`](guide/en#output-banner-output-footer), except that the code goes *inside* any format-specific wrapper.
441+
Similar to [`output.banner/output.footer`](guide/en#outputbanneroutputfooter), except that the code goes *inside* any format-specific wrapper.
442442

443443
```js
444444
export default {
@@ -531,7 +531,7 @@ Type: `boolean`<br>
531531
CLI: `--preserveModules`/`--no-preserveModules`<br>
532532
Default: `false`
533533

534-
Instead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names. Requires the [`output.dir`](guide/en#output-dir) option. Tree-shaking will still be applied, suppressing files that are not used by the provided entry points or do not have side-effects when executed. This mode can be used to transform a file structure to a different module format.
534+
Instead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names. Requires the [`output.dir`](guide/en#outputdir) option. Tree-shaking will still be applied, suppressing files that are not used by the provided entry points or do not have side-effects when executed. This mode can be used to transform a file structure to a different module format.
535535

536536
#### strictDeprecations
537537
Type: `boolean`<br>

0 commit comments

Comments
 (0)