Skip to content

Instantly share code, notes, and snippets.

@dlh01
Forked from anonymous/Gruntfile.js
Last active December 18, 2015 11:29
Show Gist options
  • Save dlh01/5776000 to your computer and use it in GitHub Desktop.
Save dlh01/5776000 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
// [other stuff...]
compass: {
options: {
sassDir: 'sass',
javascriptsDir: 'javascripts',
fontsDir: 'fonts',
outputStyle: 'compressed',
environment: 'production'
},
rTheme: {
options: {
importPath: 'sass/r-only',
httpPath: '/wp-content/themes/r/',
cssDir: 'stylesheets',
imagesDir: 'img'
}
},
fTheme: {
options: {
importPath: '../f/sass/',
cssDir: '../f/stylesheets',
imagesDir: '../f/img',
httpPath: '/wp-content/themes/f/'
}
}
},
// https://github.com/pajtai/grunt-php-set-constant
setPHPConstant: {
styles: {
constant: 'R_STYLES_UPDATED',
value: '<%= grunt.template.today("yyyymmddHHMMss") %>',
file: 'functions.php'
}
},
// [other stuff...]
// Tasks
// Running `grunt styles` at the command line runs `compass` and `setPHPConstant` as defined above
grunt.registerTask('styles', ['compass', 'setPHPConstant:styles']);
};
/*
Then, later on:
wp_register_style( $handle, $src, $deps, R_STYLES_UPDATED );
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment