Did y'all know that y'all tin easily examination your SharePoint Framework spider web parts on modern pages?
If there’s 1 guy who know, it’s my friend Waldek Mastykarz. Today he had a postal service outlining how y'all tin debug/test SPFx spider web parts on a existent modern page, non the SharePoint workbench.
The main is the same every bit for extensions loading a local manifest file into the page.
?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js
Instead of adding the higher upwardly to the URL y'all tin alteration config/serve.json instead like to the default serve.json for extensions.
By changing the default serve.json from
{ "$schema": "https://dev.office.com/json-schemas/core-build/serve.schema.json", "port": 4321, "https": true, "initialPage": "https://localhost:5432/workbench", "api": { "port": 5432, "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/" } }
to something along the lines of the config below y'all are all set.
{ "$schema": "https://dev.office.com/json-schemas/core-build/serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://localhost:5432/workbench" }, "sppage": { "pageUrl": "https://tenant.sharepoint.com/sites/mysite/SitePages/Home.aspx" } }, "api": { "port": 5432, "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/" } }
The higher upwardly configuration adds a serve config named sppage, which y'all instantiate with:
gulp serve --config=sppage
If y'all desire the SharePoint page to human activity every bit the default, switch the content of default too sppage. You may add together every bit many config sections every bit y'all desire to examination on multiple pages.
Thanks for reading : Quick Tip: Easily Exam Sharepoint Framework Spider Web Parts On Modern Pages (Addendum To Waldek’S Post)