Skip to content

Instantly share code, notes, and snippets.

@mikevalstar
Created February 28, 2014 13:52
Show Gist options
  • Save mikevalstar/9271472 to your computer and use it in GitHub Desktop.
Save mikevalstar/9271472 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'retailREIT/static/js/*.js',
'!retailREIT/static/js/scripts.min.js',
'!retailREIT/static/js/jquery.mapael.js',
'!retailREIT/static/js/raphael-min.js',
'!retailREIT/static/js/raphael.js',
'!retailREIT/static/js/usa_states.js',
'!retailREIT/static/js/_moment.js'
]
},
less: {
dist: {
files: {
'retailREIT/static/css/main.min.css': [
'retailREIT/static/less/app.less',
'retailREIT/static/css/font.css'
]
},
options: {
compress: true,
// LESS source map
// To enable, set sourceMap to true and update sourceMapRootpath based on your install
sourceMap: false,
sourceMapFilename: 'retailREIT/static/css/main.min.css.map',
sourceMapRootpath: 'retailREIT/static/css'
}
}
},
uglify: {
dist: {
files: {
'retailREIT/static/js/scripts.min.js': [
'retailREIT/static/js/plugins/bootstrap/transition.js',
'retailREIT/static/js/plugins/bootstrap/alert.js',
'retailREIT/static/js/plugins/bootstrap/button.js',
'retailREIT/static/js/plugins/bootstrap/carousel.js',
'retailREIT/static/js/plugins/bootstrap/collapse.js',
'retailREIT/static/js/plugins/bootstrap/dropdown.js',
'retailREIT/static/js/plugins/bootstrap/modal.js',
'retailREIT/static/js/plugins/bootstrap/tooltip.js',
'retailREIT/static/js/plugins/bootstrap/popover.js',
'retailREIT/static/js/plugins/bootstrap/scrollspy.js',
'retailREIT/static/js/plugins/bootstrap/tab.js',
'retailREIT/static/js/plugins/bootstrap/affix.js',
'retailREIT/static/js/plugins/*.js',
'retailREIT/static/js/_*.js'
]
},
options: {
// JS source map: to enable, uncomment the lines below and update sourceMappingURL based on your install
// sourceMap: 'assets/js/scripts.min.js.map',
// sourceMappingURL: '/app/themes/roots/assets/js/scripts.min.js.map'
mangle : false
}
}
},
watch: {
less: {
files: [
'retailREIT/static/less/*.less',
'retailREIT/static/less/bootstrap/*.less'
],
tasks: ['less']
},
js: {
files: [
'<%= jshint.all %>'
],
tasks: ['jshint', 'uglify']
},
livereload: {
// Browser live reloading
// https://github.com/gruntjs/grunt-contrib-watch#live-reloading
options: {
livereload: false
},
files: [
'retailREIT/static/css/main.min.css',
'retailREIT/static/js/scripts.min.js'
]
}
},
clean: {
dist: [
'retailREIT/static/css/main.min.css',
'retailREIT/static/js/scripts.min.js'
]
}
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
// Register tasks
grunt.registerTask('default', [
'jshint',
'clean',
'less',
'uglify'
]);
grunt.registerTask('dev', [
'watch'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment