I'm trying to install two different versions of a library, and their corresponding @types
.
Adding the packages (aliased) is simple, for example underscoresjs
yarn add old-underscore@npm:underscore@1.6
yarn add new-underscore@npm:underscore@1.13
This installs two different versions of underscorejs
which can be imported like:
import oldUnderscore from "old-underscore"
import newUnderscore from "new-underscore"
All this is fine, my issue/question is on adding the @types
for these packages. Doing something like yarn add @types/new-underscore
does not work obviously as yarn can not resolve it.
The only way I've been able to make it work is by doing:
yarn add @types/new-underscore@npm:@types/underscore@npm:1.11.3
This works for me but I don't know how I can get the correct @types
for old-underscore
. The @npm:1.11.3
corresponds to new-underscore
. I can't seem to determine what the correct @types
version will belong to old-underscore
(i.e underscore@1.6
)
FYI: yarn add @types/underscore
results in version 1.11.3
which is only why I'm using that particular version.