Last active
September 8, 2015 20:45
-
-
Save corinna000/831cd15e19df8f8230f6 to your computer and use it in GitHub Desktop.
Revisions
-
corinna000 revised this gist
Sep 8, 2015 . No changes.There are no files selected for viewing
-
corinna000 created this gist
Sep 8, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ /** * Generic Gulpfile for building small AngularJS modules. This does the *very minimum* * amount of work to get a module to build. * npm install --save-dev gulp gulp-concat gulp-ng-annotate gulp-uglify del */ var gulp = require('gulp'); var concat = require('gulp-concat'); var annotate = require('gulp-ng-annotate'); var uglify = require('gulp-uglify'); var config = require('./package.json'); var del = require('del'); // configure for your source files var src = ['./src/**/*.module.js', './src/**/*.js', '!./src/**/*.spec.js']; // reads the name of the module distributable from package.json var match = config.main.match(/(.*)[/](.*)/); var path = match[1]; var file = match[2]; gulp.task('clean', function () { return del(path); }); gulp.task('build', ['clean'], function () { gulp .src(src) .pipe(concat(file)) .pipe(annotate()) .pipe(uglify()) .pipe(gulp.dest(path)); });