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

Documentation clarity and syntax improvements #4584

Merged
merged 3 commits into from Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 10 additions & 8 deletions docs/01-command-line-reference.md
Expand Up @@ -220,10 +220,7 @@ Since Rollup ships with TypeScript typings, you can leverage your IDE's Intellis
/**
* @type {import('rollup').RollupOptions}
*/
const config = {
// ...
};

const config = { /* your config */ };
export default config;
```

Expand All @@ -233,9 +230,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 +239,14 @@ 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