Skip to content

Commit 59817c4

Browse files
authored
- enabling ES2022 module (#450)
1 parent f6db596 commit 59817c4

7 files changed

+14
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This also allows for passing in different `tsconfig` files depending on your bui
5353

5454
### Some compiler options have more than one compatible value
5555

56-
* `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)).
56+
* `module`: defaults to `ES2015`. Other valid values are `ES2020`, `ES2022` and `ESNext` (required for dynamic imports, see [#54](https://github.com/ezolenko/rollup-plugin-typescript2/issues/54)).
5757

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

@@ -152,11 +152,11 @@ See [#108](https://github.com/ezolenko/rollup-plugin-typescript2/issues/108)
152152
Path to cache.
153153
Defaults to a folder in `node_modules`.
154154

155-
* `include`: `[ "*.ts+(|x)", "**/*.ts+(|x)" ]`
155+
* `include`: `[ "*.ts+(|x)", "**/*.ts+(|x)", "**/*.cts", "**/*.mts" ]`
156156

157157
By default compiles all `.ts` and `.tsx` files with TypeScript.
158158

159-
* `exclude`: `[ "*.d.ts", "**/*.d.ts" ]`
159+
* `exclude`: `[ "*.d.ts", "**/*.d.ts", "**/*.d.cts", "**/*.d.mts" ]`
160160

161161
But excludes type definitions.
162162

dist/rollup-plugin-typescript2.cjs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27904,8 +27904,8 @@ function parseTsConfig(context, pluginOptions) {
2790427904
const compilerOptionsOverride = getOptionsOverrides(pluginOptions, preParsedTsConfig);
2790527905
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
2790627906
const module = parsedTsConfig.options.module;
27907-
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext)
27908-
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.`);
27907+
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ES2022 && module !== tsModule.ModuleKind.ESNext)
27908+
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', 'module: "ES2022"', or 'module: "ESNext"'.`);
2790927909
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
2791027910
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
2791127911
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
@@ -27932,7 +27932,7 @@ catch (e) {
2793227932
// these use globals during testing and are substituted by rollup-plugin-re during builds
2793327933
const TS_VERSION_RANGE = (global === null || global === void 0 ? void 0 : global.rpt2__TS_VERSION_RANGE) || ">=2.4.0";
2793427934
const ROLLUP_VERSION_RANGE = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || ">=1.26.3";
27935-
const RPT2_VERSION = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || "0.34.1";
27935+
const RPT2_VERSION = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || "0.35.0";
2793627936
const typescript = (options) => {
2793727937
let watchMode = false;
2793827938
let supportsThisLoad = false;

dist/rollup-plugin-typescript2.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rollup-plugin-typescript2.es.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27875,8 +27875,8 @@ function parseTsConfig(context, pluginOptions) {
2787527875
const compilerOptionsOverride = getOptionsOverrides(pluginOptions, preParsedTsConfig);
2787627876
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
2787727877
const module = parsedTsConfig.options.module;
27878-
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext)
27879-
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.`);
27878+
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ES2022 && module !== tsModule.ModuleKind.ESNext)
27879+
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', 'module: "ES2022"', or 'module: "ESNext"'.`);
2788027880
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
2788127881
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
2788227882
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
@@ -27903,7 +27903,7 @@ catch (e) {
2790327903
// these use globals during testing and are substituted by rollup-plugin-re during builds
2790427904
const TS_VERSION_RANGE = (global === null || global === void 0 ? void 0 : global.rpt2__TS_VERSION_RANGE) || ">=2.4.0";
2790527905
const ROLLUP_VERSION_RANGE = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || ">=1.26.3";
27906-
const RPT2_VERSION = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || "0.34.1";
27906+
const RPT2_VERSION = (global === null || global === void 0 ? void 0 : global.rpt2__ROLLUP_VERSION_RANGE) || "0.35.0";
2790727907
const typescript = (options) => {
2790827908
let watchMode = false;
2790927909
let supportsThisLoad = false;

dist/rollup-plugin-typescript2.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup-plugin-typescript2",
3-
"version": "0.34.1",
3+
"version": "0.35.0",
44
"description": "Seamless integration between Rollup and TypeScript. Now with errors.",
55
"main": "dist/rollup-plugin-typescript2.cjs.js",
66
"module": "dist/rollup-plugin-typescript2.es.js",

src/parse-tsconfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function parseTsConfig(context: RollupContext, pluginOptions: IOptions)
4444
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
4545

4646
const module = parsedTsConfig.options.module!;
47-
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext)
48-
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.`);
47+
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ES2022 && module !== tsModule.ModuleKind.ESNext)
48+
context.error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', 'module: "ES2022"', or 'module: "ESNext"'.`);
4949

5050
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
5151

0 commit comments

Comments
 (0)