Skip to content

Running grunt build, the name of images in the assets folder been changed, but the image name in the CSS not been updated. #1534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dylannnn opened this issue Jan 5, 2016 · 7 comments

Comments

@dylannnn
Copy link

dylannnn commented Jan 5, 2016

When build the app, the task will add timestamp to the images in the assets > images folde. I understand this is to solve the browser cache issue. But somehow, the name of the images been used in the css hasn't been updated. so those images won't shows on the website.

Example:

I have an image (abc.jpg) in the assets/images folder
I use in the css:
background-image: url(./assets/images/abc.jpg);

After build task,
The image's name changed to "abc.xxxxxxxxxx.jpg" (xxxxxxxxxx is the timestamp)

I can comment that task in the Gruntfile.js

filerev: {
dist: {
src: [
'<%= yeoman.dist %>/<%= yeoman.client %>/!(bower_components){,/}.{js,css}',
// This ONE '<%= yeoman.dist %>/<%= yeoman.client %>/assets/images/{,/}.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/<%= yeoman.client %>/assets/fonts/*'
]
}
}

But, I would like to know if there is a way to make it works without comment that line out?

@JosselinTD
Copy link

+1 Same problem here, the css is not updated

@arkdelkaos
Copy link

Until is fixed, you can comment 'filerev' in the grunt task 'build' at the Gruntfile.js, and then the filenames will not be renamed :)
The rename thing. as you may read at https://github.com/yeoman/grunt-filerev, is for browser caching purposes; IMHO you can live without it for a while 👍

@Ilshidur
Copy link

Related to : #802

@drochag
Copy link
Contributor

drochag commented Apr 7, 2016

@Awk34 which was the solution for this? Saw you closed this on March 7th, but couldn't find the fix or the duplicate

@drochag
Copy link
Contributor

drochag commented Apr 7, 2016

found on the updated code the fix, for anyone still having troubles with this here it is

@Awk34
Copy link
Member

Awk34 commented Apr 8, 2016

@danmmx closed because it was a duplicate

@drochag
Copy link
Contributor

drochag commented Apr 8, 2016

yeah, but didn't found the duplicate anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants