Created
May 22, 2014 21:28
-
-
Save austinjreilly/0b3baf7797556591ef4d to your computer and use it in GitHub Desktop.
Basic Grunt/Sass Setup
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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
build: { | |
src: 'js/scripts.js', | |
dest: 'js/scripts.min.js' | |
} | |
}, | |
sass: { | |
dev: { | |
src: ['sass/**/*.scss'], | |
dest: 'style.css', | |
}, | |
}, | |
watch: { | |
php: { | |
files: [ '**/*.php' ], | |
options: { | |
livereload: true, | |
} | |
}, | |
sass: { | |
//We watch and compile sass files as normal but don't live reload here | |
files: ['sass/**/*.scss'], | |
tasks: ['sass'], | |
options: { | |
livereload: true, | |
} | |
}, | |
options: { | |
livereload: { | |
options: { | |
livereload: true | |
} | |
} | |
} | |
}, | |
}); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
// Default task(s). | |
grunt.registerTask('default', ['watch']); | |
}; |
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": "basic-grunt-sass-setup", | |
"version": "0.1.0", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-contrib-sass": "^0.7.3", | |
"grunt-contrib-uglify": "^0.4.0", | |
"grunt-contrib-watch": "^0.6.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment