Bugfix: keep d.ts files for external libs #859
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were missing the type declaration files for the external libs, which made it problematic to work with typescript. Ex. A package developers wants to extend some element from the UI Library.
The problem was that we deleted the entire external folder (including d.ts. files) when preparing the external libs for the browser through rollup.
I have made a small change that only removes the non browser compatible .js files, before creating the correct .js files. This leaves all the d.ts files behind and typescript is able to pick them up.
I have done a small prepack test of the final output which you can see in the screenshots below.
Be aware, if you set up a custom tsconfig.json file.
moduleResolution
should be set tobundler
to support the exports field in the backoffice npm package.