Skip to content

Instantly share code, notes, and snippets.

@imjakechapman
Created January 13, 2014 03:09
Show Gist options
  • Select an option

  • Save imjakechapman/8394105 to your computer and use it in GitHub Desktop.

Select an option

Save imjakechapman/8394105 to your computer and use it in GitHub Desktop.
Super basic Grunt.js setup for js and css files
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
uglify: {
dist: {
src: ['assets/js/vendor/jquery.js', 'assets/js/vendor/**/*.js'],
dest: "assets/js/vendor.min.js"
}
},
sass: {
options: {
style: "expanded",
lineNumbers: true
},
dist: {
files: { 'assets/styles/application.css': 'assets/styles/application.scss' }
}
},
watch: {
scripts: {
files: ['assets/js/**/*.js', '!assets/js/vendor.min.js'],
tasks: ['uglify'],
options: {
spawn: false,
},
},
css: {
files: ['assets/styles/**/*.scss'],
tasks: ['sass'],
options: {
spawn: false,
}
}
}
});
grunt.registerTask('default', ['uglify', 'sass']);
};
{
"name": "PACKAGE NAME",
"version": "PACKAGE VERSION",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-sass": "~0.5.1",
"grunt-contrib-watch": "~0.4.3",
"grunt-contrib-uglify": "~0.2.0",
"matchdep": "~0.1.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment