I have the following directory structure (only showing the relevant bits for illustration purposes):
proj \
\ Gruntfile.js
\ package.json
\ test \ (all my tests are in this folder structure)
\ app \
\ index.html
\ scripts \ (all my scripts are in here)
\ views \ (all views are in here)
\ styles \
\ style.css
\ oldie.css
\ print.css
\ images \
\ hires \ (all high resolution images are here)
\ lowres \ (all low resolution images are here)
The compass section of my Gruntfile.js file looks like this:
compass: {
options: {
require: "susy",
sassDir: '<%= my.app %>/styles',
cssDir: '.tmp/styles',
imagesDir: '<%= my.app %>/images',
javascriptsDir: '<%= my.app %>/scripts',
fontsDir: '<%= my.app %>/styles/fonts',
importPath: 'app/components',
relativeAssets: true
},
dist: {},
server: {
options: {
debugInfo: true
}
}
}
The <%= my.app %>
resolves to app
. My problem is that I am unable to specify that the images in the generated CSS files should have paths that start with images/
, and not app/images
as they currently do.
If I change imagesDir: '<%= my.app %>/images'
to imagesDir: 'images'
(or add the latter as a value for the imagesPath
option) I get the following error when compass tries to compile:
No files were found in the load path matching "lowres/sprites/*.png". Your current load paths are: /Users/joachimdyndale/Development/myProject/myapp_joachim/proj/images
I've tried adding a config: 'compass.rb'
property and have the following in the compass.rb file:
http_images_path = '../images'
http_generated_images_path = '../images'
However, the above has no effect at all.
So my question is then: Is there some way I haven't discovered yet to configure all this so that it both finds the images and writes the correct path to the CSS file, or do I have to change my directory structure so that I move everything in the app
folder one level up? I really like the current structure, but I concede this may currently be an edge case Compass simply doesn't support.
I'm using the grunt-contrib-compass
grunt plugin.