Skip to content

Instantly share code, notes, and snippets.

@apisandipas
Created October 29, 2013 13:44
Show Gist options
  • Save apisandipas/7214906 to your computer and use it in GitHub Desktop.
Save apisandipas/7214906 to your computer and use it in GitHub Desktop.
Basic SCSS compiling / JS linting Gruntfile. `grunt` or `grunt watch` for development. `grunt build` will compress css ouput.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'./css/screen.css' : './src/scss/screen.scss'
}
},
dev : {
options: {
style: 'nested'
},
files: {
'./css/screen.css' : './src/scss/screen.scss'
}
}
},
jshint: {
options: {
browser: true,
'-W030': true,
globals: {
jQuery: true
},
},
all: ['./src/js/**/*.js', 'Gruntfile.js']
},
watch : {
options: {
livereload: true,
},
twig: {
files: ['views/**/*.twig']
},
scss: {
files: ['**/*.scss'],
tasks: ['sass:dev']
},
scripts: {
files: ['./js/**/*.js', 'Gruntfile.js'],
tasks: ['jshint']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['sass:dist']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment