Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Added Gulp and NPM to automate minify using Uglify..
Browse files Browse the repository at this point in the history
  • Loading branch information
De Ville Weppenaar committed Oct 23, 2015
1 parent cdfae8c commit b354c82
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.*
node_modules/
bower_components/
.idea/
25 changes: 25 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var del = require('del');
var path = require('path');
var rename = require('gulp-rename');
var uglifySaveLicense = require('uglify-save-license');

gulp.task('clean', function (done) {
del([
path.join('./', 'angular-google-gapi.min.js')], done);
});

gulp.task('compress', function() {
return gulp.src('angular-google-gapi.js')
.pipe(uglify({
mangle: false,
preserveComments: uglifySaveLicense
}))
.pipe(rename({
extname: '.min.js'
}))
.pipe(gulp.dest('./'));
});

gulp.task('default', ['clean', 'compress']);
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@
"url": "https://github.com/maximepvrt/angular-google-gapi/issues"
},
"homepage": "https://github.com/maximepvrt/angular-google-gapi"
}
"devDependencies": {
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.4.2",
"path": "^0.12.7",
"uglify-save-license": "^0.4.1"
}
}

0 comments on commit b354c82

Please sign in to comment.