Switch to grunt-contrib-less, add LESS source maps support

This commit is contained in:
Ben Word
2013-11-06 13:38:21 -06:00
parent b08510fcba
commit 3b64f10111
5 changed files with 17 additions and 10 deletions

View File

@@ -1,3 +1,6 @@
### HEAD
* Replace `grunt-recess` with `grunt-contrib-less`, add LESS source maps support
### 6.5.1: November 5th, 2013 ### 6.5.1: November 5th, 2013
* Move clean URLs to a [plugin](https://github.com/roots/roots-rewrites) * Move clean URLs to a [plugin](https://github.com/roots/roots-rewrites)
* Update to Bootstrap 3.0.1 * Update to Bootstrap 3.0.1

View File

@@ -13,16 +13,20 @@ module.exports = function(grunt) {
'!assets/js/scripts.min.js' '!assets/js/scripts.min.js'
] ]
}, },
recess: { less: {
dist: { dist: {
options: {
compile: true,
compress: true
},
files: { files: {
'assets/css/main.min.css': [ 'assets/css/main.min.css': [
'assets/less/app.less' 'assets/less/app.less'
] ]
},
options: {
compress: true,
// LESS source maps
// To enable, set sourceMap to true and update sourceMapRootpath based on your install
sourceMap: false,
sourceMapFilename: 'assets/css/main.min.css.map',
sourceMapRootpath: '/app/themes/roots/'
} }
} }
}, },
@@ -98,13 +102,13 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-wp-version'); grunt.loadNpmTasks('grunt-wp-version');
// Register tasks // Register tasks
grunt.registerTask('default', [ grunt.registerTask('default', [
'clean', 'clean',
'recess', 'less',
'uglify', 'uglify',
'version' 'version'
]); ]);

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@
* 3. /theme/assets/js/main.min.js (in footer) * 3. /theme/assets/js/main.min.js (in footer)
*/ */
function roots_scripts() { function roots_scripts() {
wp_enqueue_style('roots_main', get_template_directory_uri() . '/assets/css/main.min.css', false, 'eb6334a114ec5f4f5c96dff76170aade'); wp_enqueue_style('roots_main', get_template_directory_uri() . '/assets/css/main.min.css', false, 'a4c847d89df381990f5da6cc36bfb85a');
// jQuery is loaded using the same method from HTML5 Boilerplate: // jQuery is loaded using the same method from HTML5 Boilerplate:
// Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline // Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline

View File

@@ -23,7 +23,7 @@
"grunt-contrib-jshint": "~0.6.4", "grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "~0.2.4", "grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3", "grunt-contrib-watch": "~0.5.3",
"grunt-recess": "~0.4.0", "grunt-contrib-less": "~0.8.1",
"grunt-wp-version": "~0.1.0" "grunt-wp-version": "~0.1.0"
} }
} }