Eliminate gulp-flatten

pull/3019/head
Mark McDowall 6 years ago
parent 7ed2776476
commit 95bb73c5ac

@ -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());
});

@ -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: {

@ -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",

@ -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"

Loading…
Cancel
Save