diff --git a/docs/01-command-line-reference.md b/docs/01-command-line-reference.md index 601389c26d7..5ebd91ce780 100755 --- a/docs/01-command-line-reference.md +++ b/docs/01-command-line-reference.md @@ -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; ``` @@ -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: @@ -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 diff --git a/docs/999-big-list-of-options.md b/docs/999-big-list-of-options.md index e09c71af6f8..a251653576b 100755 --- a/docs/999-big-list-of-options.md +++ b/docs/999-big-list-of-options.md @@ -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`: @@ -1075,7 +1075,7 @@ Type: `boolean | 'inline' | 'hidden'`
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`
CLI: `--sourcemapBaseUrl `