SOLVED

How to set a path of asset library in spfx web part?

Copper Contributor

Hi,

I'm trying to use SharePoint asset folder for js files (webpart\temp\deploy) that generate with the web part. I added that path in the CDN but I'm still getting this on deployment that client side solution will get content from localhost.

This client side solution will get content from the following domains:

https://localhost:4321/

 

Thanks,

-Sal

3 Replies

@ejagmtg,

If you are looking for hosting your client-side web part from Microsoft 365 CDN then check below references:

  1. Host your client-side web part from Microsoft 365 CDN 
  2. SharePoint Framework - Deploy SPFx WebParts To Office 365 Public CDN 

Please click Mark as Best Response if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Like.

@ganeshsanap Thanks for the response, I read both links but not able to get the settings correct. I set the path in the cdnBasePath write-manifest.json but still showing me localhost when I try to upload the package.

 

Thanks,

-Sal

best response confirmed by ejagmtg (Copper Contributor)
Solution

@ejagmtg Use SharePoint frame work 1.4 or higher, if we do that then we can just include an option "includeClientSideAssets"true in Package-solution.json , that include all asset files with the package solution file and then you can just upload one file to the app catalog and all set with the webpart.

1 best response

Accepted Solutions
best response confirmed by ejagmtg (Copper Contributor)
Solution

@ejagmtg Use SharePoint frame work 1.4 or higher, if we do that then we can just include an option "includeClientSideAssets"true in Package-solution.json , that include all asset files with the package solution file and then you can just upload one file to the app catalog and all set with the webpart.

View solution in original post