-
Notifications
You must be signed in to change notification settings - Fork 587
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
[api-extractor] Inline imports sometimes incorrectly hoisted (unmodified) into rollups #4507
Comments
@octogonz In our last chat, we discussed this issue (or at least a manifestation of it). I was finally able to minify a repro, which I've outlined above and in a sandbox here: https://github.com/Josmithr/api-extractor-playground/tree/relative-path-import-repro. Let me know if you have any questions. |
Josmithr
added a commit
to microsoft/FluidFramework
that referenced
this issue
Feb 2, 2024
…o related github issue (#19465) Adds additional workaround for existing issue, and links to microsoft/rushstack#4507
alexvy86
pushed a commit
to alexvy86/FluidFramework
that referenced
this issue
Feb 13, 2024
…o related github issue (microsoft#19465) Adds additional workaround for existing issue, and links to microsoft/rushstack#4507
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are cases where TSC decides it's okay to inline
import
calls.In most cases, API-Extractor seems to handle these correctly when generating its rollups, but there are some cases where it fails to do so, potentially hoisting relative file path imports as-is into the rollup.
A contrived example
A package contains the following file structure:
foo/Foo.ts
index.ts
TSC generates the following
foo/Foo.d.ts
:API-Extractor then generates the following (untrimmed) rollup:
Note that the untrimmed rollup file lives one level higher in the directory hierarchy than
foo
, but it hoisted the../Bar
import unmodified, resulting in an invalid rollup.The above example has also been captured here: https://github.com/Josmithr/api-extractor-playground/tree/relative-path-import-repro
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?node -v
)?The text was updated successfully, but these errors were encountered: