Last active
August 29, 2015 14:08
-
-
Save rbk/be082cc88ded3aa6972e to your computer and use it in GitHub Desktop.
Sample grunt configuration files for processing sass and compressing javascripts
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) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
dist: { | |
options: { | |
style: 'compressed' | |
}, | |
files: { | |
'css/app.css' : 'scss/app.scss' | |
} | |
} | |
}, | |
uglify: { | |
options: { | |
mangle: true, | |
compress: { | |
drop_console: true | |
} | |
}, | |
my_target: { | |
options: { | |
beautify: true | |
}, | |
files: { | |
'js/build/production.min.js': [] | |
} | |
} | |
}, | |
watch: { | |
css: { | |
files: '**/*.scss', | |
tasks: ['sass'] | |
}, | |
js: { | |
files: 'js/*.js', | |
tasks: ['uglify'] | |
}, | |
livereload: { | |
files: ['*.html', '**/*.php', 'js/**/*.{js,json}', 'css/*.css','img/**/*.{png,jpg,jpeg,gif,webp,svg}'], | |
options: { | |
livereload: true | |
} | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-livereload'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
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": "any-project", | |
"version": "0.0.1", | |
"description": "grunt", | |
"private": true, | |
"devDependencies": { | |
"grunt": "~0.4.5", | |
"grunt-contrib-jshint": "~0.10.0", | |
"grunt-contrib-nodeunit": "~0.3.3", | |
"grunt-contrib-sass": "~0.7.3", | |
"grunt-contrib-uglify": "~0.4.0", | |
"grunt-contrib-watch": "~0.6.1", | |
"grunt-livereload": "^0.1.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment