Skip to content

Commit

Permalink
Add one line header instead of two line header. Include license. Add …
Browse files Browse the repository at this point in the history
…header to the non-minified, browserified build file, too.
  • Loading branch information
mondalaci committed Jun 26, 2015
1 parent 054c579 commit cf2d825
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gulpfile.js
Expand Up @@ -13,8 +13,11 @@ var gulp = require('gulp-param')(require('gulp'), process.argv),
DEST = 'dist',
SRC_COMPILED = 'underscore.string.js',
MIN_FILE = 'underscore.string.min.js',
VERSION_FILES = ['./package.json', './component.json', './bower.json'];
VERSION_FILES_JS = [SRC, 'package.js'];
VERSION_FILES = ['./package.json', './component.json', './bower.json'],
VERSION_FILES_JS = [SRC, 'package.js'],
package = require('./package.json'),
headerText = '// ' + package.name + ' ' + package.version + ' | ' +
package.license + ' licensed | ' + package.homepage + '\n\n';

gulp.task('test', ['browserify'], function(cov) {
var reporters = ['html'];
Expand Down Expand Up @@ -52,6 +55,7 @@ gulp.task('browserify', function() {
detectGlobals: true,
standalone: 's'
}))
.pipe(header(headerText))
.pipe(rename('underscore.string.js'))
.pipe(gulp.dest(DEST));
});
Expand Down Expand Up @@ -83,10 +87,9 @@ gulp.task('bump', ['bump-in-js'], function(semver) {
});

gulp.task('build', ['test', 'clean'], function() {
var package = require('./package.json');
gulp.src(DEST + '/' + SRC_COMPILED)
.pipe(uglify())
.pipe(header('// ' + package.name + ' ' + package.version + '\n// ' + package.homepage + '\n\n'))
.pipe(header(headerText))
.pipe(rename(MIN_FILE))
.pipe(gulp.dest(DEST));
});

0 comments on commit cf2d825

Please sign in to comment.