简体   繁体   English

JSPM-是否有方法或需要对捆绑文件进行版本控制?

[英]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. 我正在使用JSPM和SystemJS加载和捆绑前端代码。 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. 我通常要做的一件事是用包名保存一个json文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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