作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
这是我的 html:
<img src="../images/zulazlogo.png" alt="image1" >
但是在运行 grunt build 之后图像名称是:
5cadd58e.zulazlogo.png
这是由于 grunt-rev 任务。
有没有办法调整 html 以包含构建语句以根据新名称更改文件?像这样的东西:
<img src="../images/@@hashzulalogo.png" alt="image1">
最佳答案
您是否尝试过注释掉 grunt-rev 图像部分?
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
// '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
}
关于javascript - 用 grunt : grunt-rev task changes my images by adding a random hash and thus prevents my html from identify them 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20362444/
我是一名优秀的程序员,十分优秀!