From 7ef5fe8cecd307412a980b19b377615c850a43fe Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 23 Jan 2020 16:23:52 -0800 Subject: [PATCH] Update gulp task for package-json to remove scripts. (#3650) --- gulpfile.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ef9fb4148..33b0e09ef 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -867,9 +867,15 @@ gulp.task('package-media', function() { /** * This task copies the package.json file into the distribution directory. */ -gulp.task('package-json', function() { - return gulp.src('./package.json') - .pipe(gulp.dest(`${packageDistribution}`)) +gulp.task('package-json', function(cb) { + const json = Object.assign({}, packageJson); + delete json['scripts']; + if (!fs.existsSync(packageDistribution)) { + fs.mkdirSync(packageDistribution); + } + fs.writeFileSync(`${packageDistribution}/package.json`, + JSON.stringify(json, null, 2)); + cb(); }); /**