Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a fix to add proper --tag when doing gulp build or bundle #1635

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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