Skip to content

Instantly share code, notes, and snippets.

@austinjreilly
Created May 22, 2014 21:28
Show Gist options
  • Save austinjreilly/0b3baf7797556591ef4d to your computer and use it in GitHub Desktop.
Save austinjreilly/0b3baf7797556591ef4d to your computer and use it in GitHub Desktop.
Basic Grunt/Sass Setup
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']);
};
{
"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