Skip to content

Instantly share code, notes, and snippets.

@jshawl
Created December 13, 2013 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshawl/7946647 to your computer and use it in GitHub Desktop.
Save jshawl/7946647 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
// the banner is inserted at the top of the output
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
build: {
src: 'dist/scripts.js',
dest: 'dist/scripts.min.js'
}
},
concat: {
dist: {
src: ['src/vendor/*.js','src/*.js'],
dest: 'dist/scripts.js'
}
},
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'css/style.css' : 'scss/style.scss'
}
}
},
connect: {
all: {
options: {
port: 9000,
hostname: '0.0.0.0',
base: './',
keepalive: true,
livereload: true
}
}
},
watch: {
options: {
livereload: true
},
js: {
files: ['js/src/*.js'],
tasks: ['concat','uglify'],
options: {
spawn: false
}
},
scss: {
files: ['scss/*.scss'],
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default',['concat','uglify']);
grunt.registerTask('server',[
'connect',
'watch'
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment