Skip to content

Instantly share code, notes, and snippets.

@kbond
Last active December 31, 2015 03:39
Show Gist options
  • Save kbond/7928724 to your computer and use it in GitHub Desktop.
Save kbond/7928724 to your computer and use it in GitHub Desktop.
Grunt configuration
module.exports = function (grunt) {
grunt.initConfig({
modernizr: {
devFile: "remote",
outputFile: "web/_static/js/modernizr.js",
files: ["web/js/*", "web/css/*"]
},
jshint: {
options: {
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js',
'web/js/*'
]
},
uglify: {
options: {
report: 'min',
banner: '/*! <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
files: {
'web/_static/js/app.min.js': [
'web/vendor/jquery/jquery.js',
'web/js/app.js'
]
}
}
},
cssmin: {
options: {
report: 'min',
root: 'web',
target: 'web'
},
build: {
files: {
'web/_static/css/style.min.css': ['web/vendor/bootstrap/docs/assets/css/bootstrap.css']
}
}
},
watch: {
scripts: {
files: ["web/js/*", "web/css/*"],
tasks: ['jshint', 'uglify', 'cssmin']
}
},
clean: ['web/_static/*']
});
grunt.loadNpmTasks("grunt-modernizr");
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['jshint', 'uglify', 'cssmin']);
grunt.registerTask('production', ['clean', 'jshint', 'uglify', 'cssmin', 'modernizr']);
};
{
"name": "grunttest",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.6.3",
"jshint-stylish": "~0.1.4",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-modernizr": "~0.4.1",
"grunt-contrib-clean": "~0.5.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment