Created
March 19, 2013 09:10
-
-
Save lmartins/5194675 to your computer and use it in GitHub Desktop.
First attempt at configuring Grunt to compile Sass and soft refresh the browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module:false*/ | |
var path = require('path'); | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var folderMount = function folderMount(connect, point) { | |
return connect.static(path.resolve(point)); | |
}; | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
// Metadata. | |
pkg: grunt.file.readJSON('package.json'), | |
connect: { | |
livereload: { | |
options: { | |
port: 9001, | |
middleware: function(connect, options) { | |
return [lrSnippet, folderMount(connect, '../../')] | |
} | |
} | |
} | |
}, | |
regarde: { | |
txt: { | |
files: ['css-src/**/*.scss', 'src/js/*.coffee', 'index.html'], | |
tasks: ['compass','livereload'] | |
} | |
}, | |
compass: { | |
dist: { | |
options: { | |
sassDir: 'css-src', | |
cssDir: 'css', | |
environment: 'production' | |
} | |
}, | |
dev: { | |
options: { | |
sassDir: 'src/sass', | |
cssDir: 'dist/css' | |
} | |
} | |
} | |
}); | |
// These plugins provide necessary tasks. | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
grunt.loadNpmTasks('grunt-regarde'); | |
grunt.loadNpmTasks('grunt-contrib-livereload'); | |
grunt.loadNpmTasks('grunt-notify'); | |
// Default task. | |
grunt.registerTask('default', ['livereload-start', 'regarde']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment