Skip to content

Commit

Permalink
Fix to add proper --tag when doing gulp build or bundle (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich authored and matthewlane committed Sep 29, 2017
1 parent f9fa759 commit 0038e8e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,22 @@ function bundle(dev, moduleArr) {

var entries = [helpers.getBuiltPrebidCoreFile(dev)].concat(helpers.getBuiltModules(dev, modules));

var outputFileName = argv.bundleName ? argv.bundleName : 'prebid.js';

// change output filename if argument --tag given
if (argv.tag && argv.tag.length) {
outputFileName = outputFileName.replace(/\.js$/, `.${argv.tag}.js`);
}

gutil.log('Concatenating files:\n', entries);
gutil.log('Appending ' + prebid.globalVarName + '.processQueue();');
gutil.log('Generating bundle:', outputFileName);

return gulp.src(
entries
)
.pipe(gulpif(dev, sourcemaps.init({loadMaps: true})))
.pipe(concat(argv.bundleName ? argv.bundleName : 'prebid.js'))
.pipe(concat(outputFileName))
.pipe(gulpif(!argv.manualEnable, footer('\n<%= global %>.processQueue();', {
global: prebid.globalVarName
}
Expand Down Expand Up @@ -142,11 +150,6 @@ gulp.task('devpack', ['clean'], function () {
gulp.task('webpack', ['clean'], function () {
var cloned = _.cloneDeep(webpackConfig);

// change output filename if argument --tag given
if (argv.tag && argv.tag.length) {
cloned.output.filename = 'prebid.' + argv.tag + '.js';
}

delete cloned.devtool;

var externalModules = helpers.getArgModules();
Expand Down

0 comments on commit 0038e8e

Please sign in to comment.