Skip to content

Instantly share code, notes, and snippets.

@fervisa
Created April 19, 2015 15:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fervisa/457220be9ae292805459 to your computer and use it in GitHub Desktop.
Save fervisa/457220be9ae292805459 to your computer and use it in GitHub Desktop.
Gruntfile to process Angular/Ionic sass, coffee, haml files into css, js, html
/* Gruntfile.js
* Grunt workflow for building AngularJS/Ionic applications.
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compile: {
files: {
'www/js/app.js': ['coffee/**/*.coffee']
}
}
},
sass: {
dist: {
expand: true,
cwd: 'scss/',
src: '**/*.scss',
dest: 'www/css',
ext: '.css'
}
},
haml: {
dist: {
expand: true,
cwd: 'haml/',
src: '**/*.haml',
dest: 'www/',
ext: '.html'
}
},
ngAnnotate: {
application: {
files: {
'www/js/app.js': ['www/js/app.js']
}
}
},
watch: {
scripts: {
files: [
'coffee/**/*.coffee'
],
tasks: ['newer:coffee']
},
styles: {
files: [
'scss/**/*.scss'
],
tasks: ['newer:sass']
},
views: {
files: ['haml/**/*.haml'],
tasks: ['newer:haml']
}
},
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-haml');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-newer');
grunt.registerTask(
'build',
'Builds scripts and styles and watches for changes',
['haml', 'sass', 'coffee', 'ngAnnotate', 'watch']
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment