Skip to content

Instantly share code, notes, and snippets.

@ErikBernskiold
Created July 10, 2014 07:53
Show Gist options
  • Select an option

  • Save ErikBernskiold/ab8419cb0fd96f78d272 to your computer and use it in GitHub Desktop.

Select an option

Save ErikBernskiold/ab8419cb0fd96f78d272 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
src: 'assets/js/main.js',
dest: 'assets/js/main.min.js'
}
},
autoprefixer: {
dist: {
files: {
'assets/css/layout.css': 'assets/css/layout.css'
}
}
},
sass: {
dist: {
options: {
style: 'compressed',
sourcemap: true,
},
files: {
'assets/css/layout.css': 'assets/sass/layout.scss'
}
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: ['assets/js/*.js'],
tasks: ['uglify'],
options: {
spawn: false,
}
},
css: {
files: [
'assets/sass/*.scss',
],
tasks: [ 'sass', 'autoprefixer' ],
options : {
spawn: false,
}
}
},
});
// Load Plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
// Run!
grunt.registerTask('default', ['sass', 'uglify', 'watch']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment