Ability to adjust module resolution for a 3rd party component #7287
Labels
P5
The team acknowledges the request but does not plan to address it, it remains open for discussion
severity2: inconvenient
Bug Report or Feature Request (mark with an
x
)Versions.
Desired functionality.
Aliasing 3rd party javascript files. I want to use Fabric.js inside an Angular4 application. Fabric.js provides an additional Javascript file that is compatible with require. But in the package.json of the fabric.js module the "main" property points to another javascript file that is not compatible with the definitions of
@types/fabric
.As stated in #6282 I used the
paths
field oftsconfig.json
to redirect the module resolution to the correct file (fabric.require.js
). But this leads to typescript not recognizing the type definitions of@types/fabric
anymore. (See microsoft/TypeScript#17583)Outside an angular-cli project it would be easy to fix with a single entry to webpacks
resolve.alias
configuration. Currently inside the angular project you can choose between a working application (with the entry in tsconfig) or working typechecks (without the entry).Mention any other details that might be useful.
Reproduce my problem using a stock Angular Project with following modifications:
My
tsconfig.json
:Usage inside
app.component.ts
:Typescript should complain about
this.canvas.toSVG()
as it is wrongly defined inside the typings, but it doesn't.The text was updated successfully, but these errors were encountered: