Using the Rencore Script Check Visual Studio Code extension you can easily reference external libraries in SharePoint Framework projects the right way. Additionally, you can ensure, that the CDN they are using is well performing.
Info: To learn more about correctly referencing JavaScript libraries in SharePoint Framework projects, read the Correctly reference scripts with Rencore Script Check article.
Example of including jQuery
in your project.
Info: for jQuery, the extension will ask you two questions: URL and module name. This is because jQuery is a module. For non-module scripts, you will have to provide more information.
Example of including Cycle
which is a jQuery
plugin.
Start by opening the command prompt:
- Windows
⇧+ctrl+P
- Mac:
⇧+⌘+P
Type: SPFx Script Check
and provide information about the script you want to include in your project.
If you have ideas for new features or feedback, let us know by creating an issue in the issue list.