Skip to content

Commit

Permalink
Gulp Build: fix to populate modules list when gulp bundle is executed (
Browse files Browse the repository at this point in the history
…#6331)

* added support for pubcommon, digitrust, id5id

* added support for IdentityLink

* changed the source for id5

* added unit test cases

* changed source param for identityLink

* need to update modules list when gulp bundle is called

* added a comment
  • Loading branch information
pm-harshad-mane authored Mar 5, 2021
1 parent f250fe7 commit f51ce4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function makeWebpackPkg() {

const analyticsSources = helpers.getAnalyticsSources();
const moduleSources = helpers.getModulePaths(externalModules);
const modulesString = (externalModules.length > 0) ? externalModules.join(', ') : 'All available modules in current version.';
const modulesString = getModulesListToAddInBanner(externalModules);

return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
.pipe(helpers.nameModules(externalModules))
Expand All @@ -167,6 +167,10 @@ function makeWebpackPkg() {
.pipe(gulp.dest('build/dist'));
}

function getModulesListToAddInBanner(modules){
return (modules.length > 0) ? modules.join(', ') : 'All available modules in current version.';
}

function gulpBundle(dev) {
return bundle(dev).pipe(gulp.dest('build/' + (dev ? 'dev' : 'dist')));
}
Expand Down Expand Up @@ -216,6 +220,8 @@ function bundle(dev, moduleArr) {
return gulp.src(
entries
)
// Need to uodate the "Modules: ..." section in comment with the current modules list
.pipe(replace(/(Modules: )(.*?)(\*\/)/, ('$1' + getModulesListToAddInBanner(helpers.getArgModules()) + ' $3')))
.pipe(gulpif(dev, sourcemaps.init({ loadMaps: true })))
.pipe(concat(outputFileName))
.pipe(gulpif(!argv.manualEnable, footer('\n<%= global %>.processQueue();', {
Expand Down

0 comments on commit f51ce4e

Please sign in to comment.