Deploying with Bower

荒凉一梦 提交于 2019-12-12 01:06:45

问题


So say I am developing with bower and I have a list of my dependencies in my bower.json file. Since I am in development mode I want to have the latest stable version of the major release I'm on.

"dependencies": {
    "jquery": "1.*"
}

In order to use these files in the client I am doing something like:

<script src="/bower_components/jquery/index.js"></script>

This is nice when developing but what happens when I want to deploy and control caching by changing the file name? For example I release my site with jquery 1.05 and develop for a while and want to release a new version. I update my jquery to 1.10 through bower but everyone that viewed my site has jquery 1.05 in their cache (the file name has not changed).

Is there tools to automate this ? Essentially I would want to update jquery and have the folder name update with the version info. And reference like:

<script src="/bower_components/jquery-1.10/index.js"></script>

I know I can do something like:

"dependencies": {
    "jquery-1.10": "1.10"
}

That would produce the desired directory structure but it isn't very automated.

来源:https://stackoverflow.com/questions/21560922/deploying-with-bower

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!