Created
June 27, 2014 14:27
-
-
Save ftsanjuan/d03e43b6d45a183ac99f to your computer and use it in GitHub Desktop.
A base Angular.js app Gruntfile with sass, uglify and watch.
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
// concatenates all your js files | |
concat: { | |
js: { | |
src: ['app/app.js', 'app/js/**/**.js'], | |
dest: 'tmp/app.js' | |
} | |
}, | |
// minifies your js files | |
uglify: { | |
options: { | |
mangle: false, | |
uglify: true | |
}, | |
default: { | |
files: { | |
"app.min.js": ["tmp/app.js"] | |
} | |
} | |
}, | |
// compile sass files to css | |
sass: { | |
dist: { | |
options: { | |
style: 'expanded' | |
}, | |
files: { | |
'css/style.css': 'app/sass/app.scss' | |
} | |
} | |
}, | |
// watches for changes in project, reloads browser | |
watch: { | |
options: { | |
livereload: true | |
}, | |
files: ['app/**/*', 'app/**/**/*', 'locale/**/*', 'index.html'], | |
tasks: ['concat:js', 'sass', 'uglify'], | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
// The default tasks to run when you type 'grunt' | |
grunt.registerTask('default', ['watch']); | |
}; |
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
{ | |
"name": "NGApp", | |
"title": "ngApp", | |
"version": "1.0.0", | |
"devDependencies": { | |
"grunt": "0.4.2", | |
"grunt-contrib-concat": "0.3.0", | |
"grunt-contrib-watch" : "0.5.3", | |
"grunt-contrib-uglify" : "0.2.2", | |
"grunt-contrib-sass": "0.7.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment