added banner to distribution files. Fixes #56

This commit is contained in:
Kevin Jahns 2016-11-14 10:30:10 +01:00
parent 7415f27fbc
commit 66b6b2a568
2 changed files with 14 additions and 3 deletions

View File

@ -36,6 +36,15 @@ module.exports = function (gulp, helperOptions) {
files.distEs5 = [files.dist]
}
var header = require('gulp-header')
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n')
gulp.task('dist:es5', function () {
var babelOptions = {
presets: ['es2015']
@ -51,6 +60,7 @@ module.exports = function (gulp, helperOptions) {
.pipe($.if(!options.debug, $.uglify().on('error', function (e) {
console.log('\x07', e.message, JSON.stringify(e)); return this.end()
})))
.pipe(header(banner, { pkg : require('./package.json') } ))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('./dist/')))
})
@ -67,8 +77,8 @@ module.exports = function (gulp, helperOptions) {
.pipe($.rename({
extname: '.es6'
}))
.pipe(header(banner, { pkg : require('./package.json') } ))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('./dist/')))
})

View File

@ -53,6 +53,7 @@
"gulp-concat": "^2.6.0",
"gulp-filter": "^3.0.1",
"gulp-git": "^1.6.0",
"gulp-header": "^1.8.8",
"gulp-if": "^2.0.0",
"gulp-jasmine": "^2.0.1",
"gulp-jasmine-browser": "^0.2.3",
@ -63,6 +64,7 @@
"gulp-shell": "^0.5.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-tag-version": "^1.3.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.3.5",
"minimist": "^1.2.0",
@ -72,7 +74,6 @@
"seedrandom": "^2.4.2",
"standard": "^5.2.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"gulp-uglify": "^2.0.0"
"vinyl-source-stream": "^1.1.0"
}
}