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
As defined in the Typescript Handbook I would expect the imports of a .ts input file to be compiled by the rollup typescript plugin regardless of whether their path was matched by include or exclude.
In the case that a file is set as input, (and listed in include), but its imports are not listed in the include list, this triggers an error. A workaround is to recursively identify all the imported files in the include list, but building your own logic for this almost defeats the purpose of a bundler. If you leave an imported .ts file out of the list, (see e.g. the comparison at https://github.com/cefn/testcase_rollup/compare/exclude-all ) then when rollup gets to trying to bundle those imported .ts files you get errors like...
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
If you try to set the rootDir to the project root and add **/*.ts as the include parameter (ensuring anything is considered for transpilation during bundle), then in fact all .ts files in the whole project are transpiled, not just the ones referenced by the bundle.
Based on the handbook definitions, the rollup plugin interpretation what is 'included' in typescript compilation is not as expected. However, the feature proposed in #751 would be another way to fulfil the use case.
Additional Information
The text was updated successfully, but these errors were encountered:
Thanks for the issue. This isn't one we've heard complaints for before, but I could see how the longer compilations might be a problem in very large codebases. Please do consider submitting a PR for this one. Given the low interest I'm not sure one of the plugin's maintainers will make time to pick it up.
I just ran across #747, which appears to be identical. Since that was the first issue we received, we'll give that one priority. Please do continue discussion on that issue.
Expected Behavior
As defined in the Typescript Handbook I would expect the imports of a .ts input file to be compiled by the rollup typescript plugin regardless of whether their path was matched by include or exclude.
Actual Behavior
In the case that a file is set as input, (and listed in include), but its imports are not listed in the include list, this triggers an error. A workaround is to recursively identify all the imported files in the include list, but building your own logic for this almost defeats the purpose of a bundler. If you leave an imported .ts file out of the list, (see e.g. the comparison at https://github.com/cefn/testcase_rollup/compare/exclude-all ) then when rollup gets to trying to bundle those imported .ts files you get errors like...
If you try to set the rootDir to the project root and add
**/*.ts
as the include parameter (ensuring anything is considered for transpilation during bundle), then in fact all .ts files in the whole project are transpiled, not just the ones referenced by the bundle.Based on the handbook definitions, the rollup plugin interpretation what is 'included' in typescript compilation is not as expected. However, the feature proposed in #751 would be another way to fulfil the use case.
Additional Information
The text was updated successfully, but these errors were encountered: