简体   繁体   中英

JSPM - Is there a way or need to version the bundled files?

I am using JSPM and SystemJS for loading and bundling front end code. What I wonder is that is there any need to version bundled files, if yes, how to do that because I couldn't find anything about versioning bundles.

You need to add some kind of "version" to the bundles so that if there are some changes on a bundle, the client will get the latest bundle - otherwise the client might get an older version because of browser caching or some other cache.

One possible way to do this is to add an hash to the name of the bundle so that if there are some changes, the hash will be different. However, for that to work, you will need to somehow map the name of the generated bundles when loading the page. One thing I usually do is to save a json file with the bundles names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM