Skip to content

Instantly share code, notes, and snippets.

@revsbech
Created May 27, 2014 07:13
Show Gist options
  • Save revsbech/8430f3ad66a2e40d5e12 to your computer and use it in GitHub Desktop.
Save revsbech/8430f3ad66a2e40d5e12 to your computer and use it in GitHub Desktop.
Default Gruntfile
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'../../Resources/Public/JavaScript/Vendor/*.js',
'../../Resources/Public/JavaScript/main.js',
],
dest: '../../Resources/Public/JavaScript/production.js',
}
},
uglify: {
options: {
banner: '/*! Venstre.dk Minified JS. Built: <%= grunt.template.today("yyyy-mm-dd") %> */\n',
sourceMap: true,
},
build: {
src: '../../Resources/Public/JavaScript/production.js',
dest: '../../Resources/Public/JavaScript/production.min.js'
}
},
compass: {
dist: {
options: {
config: '../../Resources/Private/Compass/config.rb',
basePath: '../../Resources/Private/Compass'
}
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: ['../../Resources/Public/JavaScript/main.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
},
},
css: {
files: ['../../Resources/Private/Compass/src/*.scss'],
tasks: ['compass'],
options: {
spawn: false,
}
}
},
});
// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Compass
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'compass']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment