Created
April 9, 2013 20:11
-
-
Save stephCoue/5348970 to your computer and use it in GitHub Desktop.
A Basic GruntFile.js… $ npm install && grunt
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
'use strict'; | |
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({ | |
livereload: { | |
port: 35729 // Default livereload listening port. | |
}, | |
connect: { | |
livereload: { | |
options: { | |
port: 9001, | |
middleware: function(connect, options) { | |
return [lrSnippet, folderMount(connect, options.base)]; | |
} | |
} | |
} | |
}, | |
// Configuration to be run (and then tested) | |
regarde: { | |
html: { | |
files: '**/*.html', | |
tasks: ['livereload'] | |
}, | |
css: { | |
files: '**/*.css', | |
tasks: ['livereload'] | |
}, | |
sass: { | |
files: '**/*.sass', | |
tasks: ['sass'] | |
} | |
}, | |
sass: { // Task | |
dist: { // Target | |
files: { // Dictionary of files | |
'css/style.css': 'sass/style.sass' // 'destination': 'source' | |
} | |
}, | |
options: { | |
'compass': true, | |
'style': 'expanded', | |
'debugInfo': true, | |
'trace': true | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-regarde'); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.loadNpmTasks('grunt-contrib-livereload'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.registerTask('default', ['livereload-start', 'connect', 'regarde']); | |
}; | |
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
{ | |
"name": "ProjectTitle", | |
"version": "0.0.1", | |
"description": "", | |
"author": "Stephane Coue", | |
"license": "BSD", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-regarde": "~0.1.1", | |
"grunt-contrib-connect": "~0.2.0", | |
"grunt-contrib-livereload": "~0.1.2", | |
"grunt-contrib-sass": "~0.3.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment