I have created the sample spfx solution and uploaded it into the app catalog and i have added it to the site page. if I am changing in the local code and if I run the gulp serve the actual changes are reflecting in the SharePoint pages also. how is this possible. anyone please explain the process.
2 Answers
You probably ran the gulp tasks for bundling and packaging without the "--ship" flag at the end, so it still connects to your localhost after deployment
You can find some guidance here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/hosting-webpart-from-office-365-cdn#prepare-web-part-assets-to-deploy
If you open the <your-webpart-guid>.manifest.json
from the \dist
folder, you will notice that the internalModuleBaseUrls property in the loaderConfig entry still refers to your local computer:
"internalModuleBaseUrls": [
"https://`your-local-machine-name`:4321/"
]
You can find more detail here.