Conversation
module: 'ES2022', update moduleResolution default to node16
module: 'ES2022', update moduleResolution default to node16module: 'ES2022', update moduleResolution default to node16, update to to TS 5.x
module: 'ES2022', update moduleResolution default to node16, update to to TS 5.xmodule: 'ES2022', update moduleResolution default to node16, update build to TS 5.x
module: 'ES2022', update moduleResolution default to node16, update build to TS 5.xmoduleResolution default to node16, update build to TS 5.x
moduleResolution default to node16, update build to TS 5.xmoduleResolution overrides, update build to TS 5.x
moduleResolution overrides, update build to TS 5.xmoduleResolution overrides, update build to TS 5.x
moduleResolution overrides, update build to TS 5.xmoduleResolution kinds, update build to TS 5.x
src/get-options-overrides.ts
Outdated
| case tsModule.ModuleResolutionKind.Bundler: | ||
| default: | ||
| overrides.moduleResolution = tsModule.ModuleResolutionKind.Node10; |
There was a problem hiding this comment.
I'm gonna need to review this in a lot more detail (need to catch up on TS changes since 5.x hit GA and refresh myself on this codebase), but I mentioned mjs support and bundler in #434 (comment).
bundler actually seemed the most appropriate at the time (since Rollup is a bundler) for Node16+, particularly due to the file extension issues. That's actually why I didn't implement support for mjs / cjs earlier because the file extension requirement could break many things (that and no user requested it)
There was a problem hiding this comment.
Yeah, this basically lowest effort to let users use more moduleResolution values without figuring out exactly what the differences are.
There was a problem hiding this comment.
So I think bundler should not be overwritten either. With that change and README modifications about this, I think we could approve and merge this in.
Without tests though, we won't be able to confirm some of the behavior of node16 / nodeNext (particularly around file extensions) -- it is possible we may need to override those two to bundler as well
Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
|
Well, shouldn't break anything. I'll release this sometime tomorrow. |
|
In 0.36.0 now |
|
@ezolenko with 0.36.0 I'm getting the following error: With the following tsconfig settings: {
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
// ...
}
}And the following Rollup plugin config settings: const fileExtensions = ['.mjs', '.cjs', '.js', '.ts', '.json'];
const plugins = [
json(),
commonjs(),
peerDepsExternal({
packageJsonPath: path.join(dir, 'package.json'),
}),
nodeResolve({
extensions: fileExtensions,
preferBuiltins: true,
exportConditions: ['node'],
mainFields: ['module', 'main'], // This instructs Rollup to prioritize ESM over CJS when resolving modules
modulesOnly: true,
}),
typescript({
check: true,
tsconfig: path.join(dir, 'tsconfig.lib.json'),
useTsconfigDeclarationDir: true,
}),
del({ targets: `${dir}/dist/*` }),
];I'm using the package following versions:
As far as I can see, this comes from these lines: |
|
@PetarKirov this PR only changed the There are potentially additional changes needed for the If you need |
|
This doesn't work with either |
Summary
Fixes #437
Details