Skip to content

Commit

Permalink
Documentation clarity and syntax improvements (#4584)
Browse files Browse the repository at this point in the history
* Documentation clarity and syntax improvements

* Fix linting

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 26, 2022
1 parent 3502ac4 commit a2b42f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 12 additions & 6 deletions docs/01-command-line-reference.md
Expand Up @@ -221,9 +221,8 @@ Since Rollup ships with TypeScript typings, you can leverage your IDE's Intellis
* @type {import('rollup').RollupOptions}
*/
const config = {
// ...
/* your config */
};

export default config;
```

Expand All @@ -233,9 +232,7 @@ Alternatively you can use the `defineConfig` helper, which should provide Intell
// rollup.config.js
import { defineConfig } from 'rollup';

export default defineConfig({
// ...
});
export default defineConfig({ /* your config */ };
```
Besides `RollupOptions` and the `defineConfig` helper that encapsulates this type, the following types can prove useful as well:
Expand All @@ -244,7 +241,16 @@ Besides `RollupOptions` and the `defineConfig` helper that encapsulates this typ
- `Plugin`: A plugin object that provides a `name` and some hooks. All hooks are fully typed to aid in plugin development.
- `PluginImpl`: A function that maps an options object to a plugin object. Most public Rollup plugins follow this pattern.
You can also directly write your config in TypeScript via the [`--configPlugin`](guide/en/#--configplugin-plugin) option.
You can also directly write your config in TypeScript via the [`--configPlugin`](guide/en/#--configplugin-plugin) option. With TypeScript you can import the `RollupOptions` type directly:
```typescript
import type { RollupOptions } from 'rollup';

const config: RollupOptions = {
/* your config */
};
export default config;
```
### Differences to the JavaScript API
Expand Down
8 changes: 4 additions & 4 deletions docs/999-big-list-of-options.md
Expand Up @@ -919,11 +919,11 @@ import './lib.js';

// lib.js
import('./dynamic.js');
export const value = 42;
export const importantValue = 42;

// dynamic.js
import { value } from './lib.js';
console.log(value);
import { importantValue } from './lib.js';
console.log(importantValue);
```

Output with `output.minifyInternalExports: true`:
Expand Down Expand Up @@ -1075,7 +1075,7 @@ Type: `boolean | 'inline' | 'hidden'`<br> CLI: `-m`/`--sourcemap`/`--no-sourcema

If `true`, a separate sourcemap file will be created. If `"inline"`, the sourcemap will be appended to the resulting `output` file as a data URI. `"hidden"` works like `true` except that the corresponding sourcemap comments in the bundled files are suppressed.

### output.sourcemapBaseUrl
#### output.sourcemapBaseUrl

Type: `string`<br> CLI: `--sourcemapBaseUrl <url>`

Expand Down

0 comments on commit a2b42f0

Please sign in to comment.