Skip to content
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

0.8 isn't rewriting my css file references to images #105

Open
karlvr opened this issue Aug 1, 2015 · 6 comments
Open

0.8 isn't rewriting my css file references to images #105

karlvr opened this issue Aug 1, 2015 · 6 comments

Comments

@karlvr
Copy link

karlvr commented Aug 1, 2015

With 0.7.6 I processed my css files separately to my images. With 0.8 is is required to process them with revAll all at once? I can debug this further if this isn't correct! If it is, perhaps this should be added to the 0.8 upgrade warning as it would be a major change.

@smysnk
Copy link
Owner

smysnk commented Aug 6, 2015

Certainly sounds like non desired behaviour, further debugging would be appreciated.

@mattvague
Copy link

This seems to be happening for me as well

@ghost
Copy link

ghost commented Sep 19, 2015

My task looks like this:

gulp.task "production", ->
  revAll = new RevAll()
  stream = gulp.src("public/assets/**")
    .pipe(revAll.revision())
    .pipe(gulp.dest("public/dist"))
    .pipe(revAll.manifestFile())
    .pipe(gulp.dest("public/dist"))

and my css files seem to be untouched with non-fingerprinted references to images.

@mediafreakch
Copy link

I had the same problem. Turned out that gulp-rev-all is looking for an absolute or relative reference to where you take your sources from. It never found a match, thus couldn't replace the reference.

Assume you have public/assets/css/styles.css and public/assets/images/image.png.
As you do gulp.src('public/assets/**') , the plugin looks for references to public/assets/images/image.png inside your styles.css.

I assume you reference just looks something like ../images/image.png? That's why it doesn't match.
I'm actually not sure if this is the expected behaviour or not.

I solved it by copying all my assets to a /tmp folder in the root of my project, then do gulp.src('/tmp/*'), which worked for me.

@gmetais
Copy link

gmetais commented Nov 27, 2015

It would be nice to have a root option, allowing to set a path in the project from where files would be looked for.

@karlvr
Copy link
Author

karlvr commented Nov 23, 2016

Over a year later I've got to the bottom of the issue that I'm having.

I use RevAll to process separate groups of files that make up my front-end files. I sometimes process all of the groups together. Sometimes separately.

For example I have groups of less files, css files, js files, image files. My gulp watch notices changes in one and then rebuilds that group, using gulp-newer to only process changed files.

I always run RevAll, not just when I do a production deploy. It enables me to test the revving in the development environment, rather than just once I push. This may or may not important any more—I haven't encountered many problems, but still, I like to catch problems in dev as not all projects have a lot of staging time.

Because I always run RevAll, previously I could run it even when just processing a small group of files, as RevAll would look at other files relative to the source files to hash them. For example, if just processing my less files, RevAll would load image files relative to the less files to calculate hashes for where the image file would end up once it had been revved.

The 0.8 changes in RevAll prevent this, as RevAll only processes references to files that are part of the process.

I am currently investigating reworking my workflow to support the changes in 0.8 (finally). I thought I'd detail this here, partly because I forgot I'd reported this issue here (and I'd forgotten some of the aspects of the issue I reported) until I saw my avatar here!

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

No branches or pull requests

5 participants