-
-
Save bonekost/acf4f4cd75b86e9a5cc8394919b6a82b to your computer and use it in GitHub Desktop.
Gruntfile to process Angular/Ionic sass, coffee, haml files into css, js, html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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