Skip to content

Commit

Permalink
fix(commonjs): declaration tag @default for ignoreTryCatch + fix some…
Browse files Browse the repository at this point in the history
… typos (#1370)
  • Loading branch information
ClementValot committed Dec 7, 2022
1 parent fb11bd3 commit a47c153
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/commonjs/types/index.d.ts
Expand Up @@ -109,17 +109,17 @@ interface RollupCommonJSOptions {
* they should be left unconverted as it requires an optional dependency
* that may or may not be installed beside the rolled up package.
* Due to the conversion of `require` to a static `import` - the call is
* hoisted to the top of the file, outside of the `try-catch` clause.
* hoisted to the top of the file, outside the `try-catch` clause.
*
* - `true`: All `require` calls inside a `try` will be left unconverted.
* - `true`: Default. All `require` calls inside a `try` will be left unconverted.
* - `false`: All `require` calls inside a `try` will be converted as if the
* `try-catch` clause is not there.
* - `remove`: Remove all `require` calls from inside any `try` block.
* - `string[]`: Pass an array containing the IDs to left unconverted.
* - `((id: string) => boolean|'remove')`: Pass a function that control
* - `((id: string) => boolean|'remove')`: Pass a function that controls
* individual IDs.
*
* @default false
* @default true
*/
ignoreTryCatch?:
| boolean
Expand All @@ -133,14 +133,14 @@ interface RollupCommonJSOptions {
* NodeJS where ES modules can only import a default export from a CommonJS
* dependency.
*
* If you set `esmExternals` to `true`, this plugins assumes that all
* If you set `esmExternals` to `true`, this plugin assumes that all
* external dependencies are ES modules and respect the
* `requireReturnsDefault` option. If that option is not set, they will be
* rendered as namespace imports.
*
* You can also supply an array of ids to be treated as ES modules, or a
* function that will be passed each external id to determine if it is an ES
* module.
* function that will be passed each external id to determine whether it is
* an ES module.
* @default false
*/
esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
Expand All @@ -158,7 +158,7 @@ interface RollupCommonJSOptions {
* import * as foo from 'foo';
* ```
*
* However there are some situations where this may not be desired.
* However, there are some situations where this may not be desired.
* For these situations, you can change Rollup's behaviour either globally or
* per module. To change it globally, set the `requireReturnsDefault` option
* to one of the following values:
Expand Down Expand Up @@ -208,7 +208,7 @@ interface RollupCommonJSOptions {
* Some modules contain dynamic `require` calls, or require modules that
* contain circular dependencies, which are not handled well by static
* imports. Including those modules as `dynamicRequireTargets` will simulate a
* CommonJS (NodeJS-like) environment for them with support for dynamic
* CommonJS (NodeJS-like) environment for them with support for dynamic
* dependencies. It also enables `strictRequires` for those modules.
*
* Note: In extreme cases, this feature may result in some paths being
Expand All @@ -222,7 +222,7 @@ interface RollupCommonJSOptions {
* To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
* that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
* may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
* home directory name. By default it uses the current working directory.
* home directory name. By default, it uses the current working directory.
*/
dynamicRequireRoot?: string;
}
Expand Down

0 comments on commit a47c153

Please sign in to comment.