-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support for module: 'ES2022'
#435
Comments
module: 'ES2022'
Feature request, not a bug
Per the error and the docs, rpt2 does not currently support WorkaroundAs a workaround, you can probably use Supporting
|
This is a major issue for me; I am using Top-Level await, and due to some other considerations I cannot use ESNext. I have worked around it for now by simply adding it to the list of checked modules types, but I'd really like something merged sooner rather than later so that this is easier for my fellow developers on my project. Hopefully this is helpful to anyone else. Rollup-Plugin-Typescript2.cjs.js Line 27907 const preParsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, getOptionsOverrides(pluginOptions), configFileName);
const compilerOptionsOverride = getOptionsOverrides(pluginOptions, preParsedTsConfig);
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
const module = parsedTsConfig.options.module;
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext && module!== tsModule.ModuleKind.ES2022)
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"'.`);
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
return { parsedTsConfig, fileName }; |
per my previous comment above and the labels on this issue, PR welcome 🙂 |
I committed the change for ES2022 along with some dependency updates, but unittests are now falling over (because of ts-jest update I expect). @agilgur5 could you take a look when you have time? Otherwise I'll revert dependency updates and make a release with just module type change. |
In 0.35.0 now |
Just checked this and it seems like Rollup has been supporting top-level await (TLA) for a while actually, since rpt2 supports down to Right now could probably argue that it is not worth the effort to implement that check (although it would only be a couple of lines) given how old that version of Rollup is and how many features of rpt2 already ask for (much) newer versions, but thought I should at least document that for posterity. |
That rollup support version is not based on much anymore aside from history and I doubt it is needed (or even works). We can bump that version to something newer in 0.36 |
Yea I'm well aware of that, but we haven't needed to bump it so far. We can proactively bump it to Rollup |
Pure coincidence, but I did stumble upon one of the reasons for the Rollup version, so thought I'd jot that down here for posterity. But yea there's a decent bit of deprecations and backward compat workarounds alongside a version bump. Might get to that this week. |
Troubleshooting
tsc
have the same output? If so, please explain why this is incorrect behaviorNo.
n/a
Yes. Minimal repo environment
What happens and why it is incorrect
When building using the node16-strictest-esm standard tsconfig the following error is generated:
[!] (plugin rpt2) RollupError: Incompatible tsconfig option. Module resolves to 'ES2022'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.
Environment
n/a, reproduces in the minimal environment
Versions
:rollup.config.js
:tsconfig.json
The text was updated successfully, but these errors were encountered: