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

docs: mention module: "ES2020" compatibility #376

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The plugin inherits all compiler options and file lists from your `tsconfig.json

#### Some compiler options have more than one compatible value.

* `module`: defaults to `ES2015`, other valid value is `ESNext` (required for dynamic imports, see [#54](https://github.com/ezolenko/rollup-plugin-typescript2/issues/54)).
* `module`: defaults to `ES2015`. Other valid values are `ES2020` and `ESNext` (required for dynamic imports, see [#54](https://github.com/ezolenko/rollup-plugin-typescript2/issues/54)).

#### Some options need additional configuration on plugin side

Expand Down
2 changes: 1 addition & 1 deletion __tests__/check-tsconfig.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("checkTsConfig", () => {
...defaultConfig,
options: { module: ts.ModuleKind.None },
})).toThrow(
`Incompatible tsconfig option. Module resolves to 'None'. This is incompatible with rollup, please use 'module: "ES2015"' or 'module: "ESNext"'.`,
"Incompatible tsconfig option. Module resolves to 'None'. This is incompatible with Rollup, please use",
);

expect(checkTsConfig({
Expand Down
4 changes: 2 additions & 2 deletions src/check-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export function checkTsConfig(parsedConfig: tsTypes.ParsedCommandLine): void
{
const module = parsedConfig.options.module!;

if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ESNext && module !== tsModule.ModuleKind.ES2020)
throw new Error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with rollup, please use 'module: "ES2015"' or 'module: "ESNext"'.`);
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext)
throw new Error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.`);
}