Gulp as pipeline: How to use asset_hash

hi everybody! I’m using a small gulp task as external pipeline. But I got two problems:

  1. How to use the asset_hash? With <%= stylesheet_link_tag ‘all’ %> it’s not including the hash at the end. How to get that working?

  2. Don’t know why but everytime I run middleman build it generates a “all” file and a “all.css” in my stylesheets directory. second is right, but the first one is file with a thrown error:

/*
Error: File to import not found or unreadable: susy.
        on line 1 of /Users/matthiasfanger/workspace/fngr2911.github.io/source/stylesheets/all.scss

1: @import 'susy';
2: @import 'reset';
3: @import 'placeholder';
4: @import 'variables';
5: @import 'style';
6: @import 'syntax';

Backtrace:
/Users/matthiasfanger/workspace/fngr2911.github.io/source/stylesheets/all.scss:1

why does gulp/middleman generates that file? susy is imported via npm and works find in serve mode.

thank you!

Could you include your Gulp task and your config.rb file? That might help diagnose the issue.

Off the top of my head:

  • If the Gulp task is doing the CSS compilation then Middleman doesn’t know about the file
  • Hashing isn’t turned on correctly
  • Middleman expects a .scss.css so it truncates the file extension (hence you get all instead of all.css)

I put together a screencast to show how to use the external pipepline which might be of use: https://www.youtube.com/watch?v=-io8EeB3GHI

Repo here: https://github.com/craigmdennis/middleman-gulp-starter/