gulp-header

How to add current source filename to gulp-header

假如想象 提交于 2020-07-09 06:15:45
问题 I minify and concatinate vendor files. It would be nice to separate the scripts in vendor.min.js with some info (like the original filename). I am using gulp-header to add a headers to my output file. // Minify vendor JS gulp.task('minify-vendor-js', function() { return gulp.src([ 'lib/**/*.js' ]) .pipe(uglify()) .on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); }) .pipe(header("// Vendor Package (compressed) - all rights reserved to the respective owners\r

How to add current source filename to gulp-header

雨燕双飞 提交于 2020-07-09 06:15:43
问题 I minify and concatinate vendor files. It would be nice to separate the scripts in vendor.min.js with some info (like the original filename). I am using gulp-header to add a headers to my output file. // Minify vendor JS gulp.task('minify-vendor-js', function() { return gulp.src([ 'lib/**/*.js' ]) .pipe(uglify()) .on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); }) .pipe(header("// Vendor Package (compressed) - all rights reserved to the respective owners\r

Including current year in Header file with Gulp Header

北城以北 提交于 2019-12-01 19:17:40
Is there anyway to print out the current year in a header file using Gulp Header ? Here's an example of what I'd like to do: var banner = ['/**', ' * Copyright (c) 2014 Cofey', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @link <%= pkg.homepage %>', ' * @license <%= pkg.license %>', ' */', ''].join('\n'); Looks like gulp uses lodash templates; you should be able to include arbitrary JavaScript: var banner = ['/**', ' * Copyright (c) <%= new Date().getFullYear() %> Cofey', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>',

Including current year in Header file with Gulp Header

喜欢而已 提交于 2019-12-01 17:21:38
问题 Is there anyway to print out the current year in a header file using Gulp Header? Here's an example of what I'd like to do: var banner = ['/**', ' * Copyright (c) 2014 Cofey', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @link <%= pkg.homepage %>', ' * @license <%= pkg.license %>', ' */', ''].join('\n'); 回答1: Looks like gulp uses lodash templates; you should be able to include arbitrary JavaScript: var banner = ['/**', ' * Copyright (c) <%= new Date()

How to inject variable value into JS file from GULP

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 19:06:59
Hopefully this is a quick question. What I'm trying to do is to add a timestamp into a Javascript object in a JS file while the file is being built with GULP. Basically, in "file.js", I have an object where I would like to have object.timeStamp that equals the time of the GULP build. I am currently adding a timestamp to the top of the file using gulp-header, but I have been asked to add the timestamp to a property in the object. My thought was to inject the value from GULP, but all of the injection plugins I have found so far are for injecting contents of one file into the target file. Any

How to inject variable value into JS file from GULP

余生长醉 提交于 2019-11-30 03:51:09
问题 Hopefully this is a quick question. What I'm trying to do is to add a timestamp into a Javascript object in a JS file while the file is being built with GULP. Basically, in "file.js", I have an object where I would like to have object.timeStamp that equals the time of the GULP build. I am currently adding a timestamp to the top of the file using gulp-header, but I have been asked to add the timestamp to a property in the object. My thought was to inject the value from GULP, but all of the