Skip to content

Commit

Permalink
fix duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed Jun 13, 2024
1 parent 6bc92c5 commit 6fa3766
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ function makeVerbose(config = webpackConfig) {
});
}

function prebidSource(webpackCfg) {
var externalModules = helpers.getArgModules();

const analyticsSources = helpers.getAnalyticsSources();
const moduleSources = helpers.getModulePaths(externalModules);

return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
.pipe(helpers.nameModules(externalModules))
.pipe(webpackStream(webpackCfg, webpack));
}

function makeDevpackPkg(config = webpackConfig) {
return function() {
var cloned = _.cloneDeep(config);
Expand All @@ -163,14 +174,7 @@ function makeDevpackPkg(config = webpackConfig) {
.filter((use) => use.loader === 'babel-loader')
.forEach((use) => use.options = Object.assign({}, use.options, babelConfig));

var externalModules = helpers.getArgModules();

const analyticsSources = helpers.getAnalyticsSources();
const moduleSources = helpers.getModulePaths(externalModules);

return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
.pipe(helpers.nameModules(externalModules))
.pipe(webpackStream(cloned, webpack))
return prebidSource(cloned)
.pipe(gulp.dest('build/dev'))
.pipe(connect.reload());
}
Expand All @@ -183,14 +187,7 @@ function makeWebpackPkg(config = webpackConfig) {
}

return function buildBundle() {
var externalModules = helpers.getArgModules();

const analyticsSources = helpers.getAnalyticsSources();
const moduleSources = helpers.getModulePaths(externalModules);

return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
.pipe(helpers.nameModules(externalModules))
.pipe(webpackStream(cloned, webpack))
return prebidSource(cloned)
.pipe(gulp.dest('build/dist'));
}
}
Expand Down

0 comments on commit 6fa3766

Please sign in to comment.