I'm trying to update an existing spfx web part by uploading the new javascript bundled files to azure storage (using gulp --ship && gulp deploy-azure-storage).

The problem is every time it generates the bundled js, the file name has a different id appended to it. That means that my web part is still looking for the old version of the javascript.

Is there a way to have a consistent name for my web part javascript file or everytime I change something I also need to package the solution and updated it in the catalog?



There is no way to update your JavaScript and keep the same production bundle filename.

The reason is that if the Framework did that, then users browser would have no way of knowing that the file has been updated and would just use the old version from the browser cache.

Waldek Mastykarz has a nice article about 5 differences between SharePoint Framework debug and release builds

  • Thanks for the reply @Per Jakobsen. I understand the problem with the browser cache but it would be nice to have something appended to the JavaScript name other than an id. Maybe the version of the app? – Rafael Rocha Sep 8 '16 at 20:11
  • I haven't examined what they're adding, but it must be some kind of hash, because if you revert a change you get the old id back. This means that it'll only burst the cache if it's really changed. – Per Jakobsen Sep 9 '16 at 7:07

every time you are creating a build, the name of javascript file changes, there is no way to the same build for any changes in the code. There is one workaround you can go for is renaming the new files to the old ones you got for your last build.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.