You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Between v10.0.1 and v11.0.0 of the @rollup/plugin-typescript package, what I suspect is the merge of #1267 regressed a feature that I was relying on.
When resolving files through the paths of a tsconfig.json, I expect .js, .cjs, .mjs and .json files to resolve, just as if they're referenced directly using relative paths in a TypeScript source file.
Actual Behavior
When resolving files through the paths of a tsconfig.json the files are externalised from the bundle.
Additional Information
The issue can be worked around by providing a value for the includes option, which includes the extensions of all the expected files: '{,**/}*.(cts|mts|ts|tsx|js|cjs|mjs|json)'. This issue might simply be a case of a misalignment in my expectations of the default and the actual default. If there's no immediate drawback, I'd suggest expanding this default value for includes to include any file extension importable from TypeScript. Alternatively, the default could be determined based on the value of the allowJsresolveJsonModule options from the loaded tsconfig.json.
As a side-note: Adding to the confusion, is that the plugin uses "includes" as the name for this option, which can easily be confused with a way to supply and alternative / overriding value for the TypeScript includes option read from the tsconfig.json. This is most likely why I originally didn't think to configure it.
The text was updated successfully, but these errors were encountered:
@rollup/plugin-typescript
v11.0.0
throughv11.1.6
v11.0.0
withrollup@3.29.4
and plugin11.1.6
withrollup@4.9.5
.Expected Behavior
Between v10.0.1 and v11.0.0 of the
@rollup/plugin-typescript
package, what I suspect is the merge of #1267 regressed a feature that I was relying on.When resolving files through the
paths
of a tsconfig.json, I expect.js
,.cjs
,.mjs
and.json
files to resolve, just as if they're referenced directly using relative paths in a TypeScript source file.Actual Behavior
When resolving files through the
paths
of atsconfig.json
the files are externalised from the bundle.Additional Information
The issue can be worked around by providing a value for the
includes
option, which includes the extensions of all the expected files:'{,**/}*.(cts|mts|ts|tsx|js|cjs|mjs|json)'
. This issue might simply be a case of a misalignment in my expectations of the default and the actual default. If there's no immediate drawback, I'd suggest expanding this default value forincludes
to include any file extension importable from TypeScript. Alternatively, the default could be determined based on the value of theallowJs
resolveJsonModule
options from the loaded tsconfig.json.As a side-note: Adding to the confusion, is that the plugin uses "includes" as the name for this option, which can easily be confused with a way to supply and alternative / overriding value for the TypeScript
includes
option read from thetsconfig.json
. This is most likely why I originally didn't think to configure it.The text was updated successfully, but these errors were encountered: