Issue in Building dll-code in SharePoint Framework
I went through the below link for Building dll-code in SharePoint Framework. everything worked well but the library added contains a single method with data returning as string.
https://blog.mastykarz.nl/dll-code-sharepoint-framework/
If we want to import angular or jQuery in the library file in the example shown above, how can we do it?
Have you tried doing it the same way as you would in a regular web part, ie. using import or require statements?
Yes I did tried by using import and require. The code breaks when we gulp build it and it gives error as typescript.d.ts file could not find the module jquery or angular.
Have you installed TypeScript typings for jquery/angular in your project?
Yes i have installed typescript for jquery/angular......
The issue occurs when we run the script written for automatically updating the typescript.d.ts file whose code is written in gulp.js file. Command : gulp build typingsfilename At that moment it is not able to find the module jquery/angular... Any help would be greatly appreciated as we have been stuck in middle of it...
Could you try removing this line and see if it helps https://github.com/waldekmastykarz/spfx-sample-dllcode/blob/b3fe3e208d7271f5f52b64cd66522207ccb4ee1c/gulpfile.js#L40?
In order to use jQuery (and other libraries) in SPFx, you should go to the following article: https://dev.office.com/sharepoint/docs/spfx/web-parts/basics/add-an-external-library
Considering this is months old and there hasn't been any update in either side, I'll close the thread.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues