From 95bb73c5acd00abb4f1f334eda8bc590f94fc7f4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 22 Mar 2019 19:07:35 -0700 Subject: [PATCH] Eliminate gulp-flatten --- frontend/gulp/copy.js | 12 ++++-------- frontend/gulp/helpers/paths.js | 14 +++++++------- package.json | 1 - yarn.lock | 8 -------- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/frontend/gulp/copy.js b/frontend/gulp/copy.js index 7345c7813..8d58ac4a4 100644 --- a/frontend/gulp/copy.js +++ b/frontend/gulp/copy.js @@ -2,7 +2,6 @@ const path = require('path'); const gulp = require('gulp'); const print = require('gulp-print').default; const cache = require('gulp-cached'); -const flatten = require('gulp-flatten'); const livereload = require('gulp-livereload'); const paths = require('./helpers/paths.js'); @@ -10,16 +9,15 @@ gulp.task('copyJs', () => { return gulp.src( [ path.join(paths.src.root, 'polyfills.js') - ]) + ], { base: paths.src.root }) .pipe(cache('copyJs')) .pipe(print()) - .pipe(flatten()) .pipe(gulp.dest(paths.dest.root)) .pipe(livereload()); }); gulp.task('copyHtml', () => { - return gulp.src(paths.src.html) + return gulp.src(paths.src.html, { base: paths.src.root }) .pipe(cache('copyHtml')) .pipe(print()) .pipe(gulp.dest(paths.dest.root)) @@ -28,22 +26,20 @@ gulp.task('copyHtml', () => { gulp.task('copyFonts', () => { return gulp.src( - path.join(paths.src.fonts, '**', '*.*') + path.join(paths.src.fonts, '**', '*.*'), { base: paths.src.root } ) .pipe(cache('copyFonts')) .pipe(print()) - .pipe(flatten({ subPath: 2 })) .pipe(gulp.dest(paths.dest.root)) .pipe(livereload()); }); gulp.task('copyImages', () => { return gulp.src( - path.join(paths.src.images, '**', '*.*') + path.join(paths.src.images, '**', '*.*'), { base: paths.src.root } ) .pipe(cache('copyImages')) .pipe(print()) - .pipe(flatten({ subPath: 2 })) .pipe(gulp.dest(paths.dest.root)) .pipe(livereload()); }); diff --git a/frontend/gulp/helpers/paths.js b/frontend/gulp/helpers/paths.js index e3263755c..8707faec4 100644 --- a/frontend/gulp/helpers/paths.js +++ b/frontend/gulp/helpers/paths.js @@ -1,15 +1,15 @@ -const root = './frontend/src/'; +const root = './frontend/src'; const paths = { src: { root, - html: `${root}*.html`, - scripts: `${root}**/*.js`, - content: `${root}Content/`, - fonts: `${root}Content/Fonts/`, - images: `${root}Content/Images/`, + html: `${root}/*.html`, + scripts: `${root}/**/*.js`, + content: `${root}/Content/`, + fonts: `${root}/Content/Fonts/`, + images: `${root}/Content/Images/`, exclude: { - libs: `!${root}JsLibraries/**` + libs: `!${root}/JsLibraries/**` } }, dest: { diff --git a/package.json b/package.json index c76143716..fb4a422cc 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "gulp-cached": "1.1.1", "gulp-concat": "2.6.1", "gulp-declare": "0.3.0", - "gulp-flatten": "0.4.0", "gulp-livereload": "4.0.1", "gulp-postcss": "8.0.0", "gulp-print": "5.0.0", diff --git a/yarn.lock b/yarn.lock index 19799c7a4..2dff34604 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3916,14 +3916,6 @@ gulp-declare@0.3.0: vinyl-map "^1.0.1" xtend "^4.0.0" -gulp-flatten@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/gulp-flatten/-/gulp-flatten-0.4.0.tgz#d9ac819416c30fd5dfb3dea9da79c83a1bcd61d1" - integrity sha512-eg4spVTAiv1xXmugyaCxWne1oPtNG0UHEtABx5W8ScLiqAYceyYm6GYA36x0Qh8KOIXmAZV97L2aYGnKREG3Sg== - dependencies: - plugin-error "^0.1.2" - through2 "^2.0.0" - gulp-livereload@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/gulp-livereload/-/gulp-livereload-4.0.1.tgz#cb438e62f24363e26b44ddf36fd37c274b8b15ee"