Gulpfile for angular 1.x and scss/sass compiling
Simply download gulpfile.js and put it on the root folder of your project, then run (make sure you are positioned in the root of your project!) :
$ npm install gulp
$ npm install gulp-uglify
$ npm install gulp-concat
$ npm install gulp-ngmin
$ npm install gulp-sass
$ npm install gulp-strip-debug
$ npm install gulp-zip
$ npm install gulp-email
After this you are all set! Just change your paths in the file and run it typing in your teminal:
$ gulp watch
It will poll for changes automatically and minimize all your files ready for distribution so there's one less thing you need to worry about! :)
When you are ready for production just hit :
$ gulp dist
To remove all the debug logs and then:
$ gulp zip
To have yout latest reales zipped and ready!
Also comes with e-mail configuration trough mailgun if you want to send the files via email (pretty useful, this one). All you need to do is type in your terminal :
$ gulp email
For angular learners, remember to inject properly the dependencies you want to use as I didn't integrate in the gulpfile ng-annotate (not always it works fine and there's nothing better than a safer solution, for this I preferer to annotate the dependencies myself)
E.g:
var MyController = ['$scope', '$http', function($scope, $http) {
//your code
}]
Is better suited for this gulpfile than:
var MyController = function($scope, $http) {
//your code
}
Feel free to contribute to this file as much as you want!
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request