Jul 22 2017 11:58 PM
Hello.
I have js file and d.ts file of some third party library that could not be installed through NPM installer.
I tried to integrate this package within Typescript-based Sharepoint Framework’s Web Part project but didn’t succeed.
I need a help and, if possible, an example solving this issue.
Thanks, Alex.
Jul 23 2017 03:44 AM
why not try using the CDN instead of installing...?
Jul 23 2017 04:34 AM
Unfortunately, the CDN is not an option for me.
Jul 23 2017 06:17 AM
What library is it? What problem are you having? How are you trying to integrate it in your project?
Jul 23 2017 06:52 AM
Hello, Waldek.
The library I try to integrate is Keylines network library from Cambridge Intelligence Company.
It's a proprietary library that is not distributed via NPM and can be accessed only with username and password at their dedicated web site.
They provide js and d.ts files for a work with Typescript.
I built a project with yeoman and I have to add manually js, d.ts files and reference them.
How should I configure such kind of library and what is the best way to deal with libraries that are not exposed through NPM installer?
Thanks, Alex.
Aug 27 2017 01:49 AM
As you can't install it via NPM, you don't have much choice other than directly referencing it in your project. Because you have TypeScript type definitions, you should be able to include the reference using an import statement. I don't know the library you mentioned so can't tell exactly how that statement should look like. If it turns out that the library isn't distributed as a module, you can use a reference clause instead. It's a bit cryptic but it's hard to provide more details without knowing the library. Hope it helps.