gruntjs minify / uglify后,在html中更改链接或脚本文件名 [英] Change link or script filename in html after gruntjs minify/uglify
本文介绍了gruntjs minify / uglify后,在html中更改链接或脚本文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对css / js文件使用标准的minify / uglify,并将多个文件合并到main.min.css或app.min.js中......但是,我的.html文件需要修改以指向这些新文件名在< link>
或< script>
<有没有办法让这个自动化?或者如何自动修改.html文件,以使用
gruntjs
?重命名文件名称。解决方案<我使用Middleman App在我的html或haml文件中区分dev和build:
- 如果开发?
和
- if build?
I am using standard minify/uglify for css/js files and combine multiple files to main.min.css or app.min.js... However my .html file needs to be modified to point to these new file names too in <link>
or <script>
Is there a way to automate this? Or how to modify .html files automatically to rename the file names in there using gruntjs
?
解决方案
I am using Middleman App do distinguish between dev vs build in my html or haml file:
- if development?
and
- if build?
这篇关于gruntjs minify / uglify后,在html中更改链接或脚本文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文