2019-03-09 02:10:23 +00:00
|
|
|
const path = require('path');
|
|
|
|
const gulp = require('gulp');
|
|
|
|
const print = require('gulp-print').default;
|
|
|
|
const cache = require('gulp-cached');
|
|
|
|
const livereload = require('gulp-livereload');
|
|
|
|
const paths = require('./helpers/paths.js');
|
2017-09-04 02:20:56 +00:00
|
|
|
|
|
|
|
gulp.task('copyJs', () => {
|
|
|
|
return gulp.src(
|
|
|
|
[
|
|
|
|
path.join(paths.src.root, 'polyfills.js')
|
2019-03-12 00:38:14 +00:00
|
|
|
], { base: paths.src.root })
|
2017-09-04 02:20:56 +00:00
|
|
|
.pipe(cache('copyJs'))
|
|
|
|
.pipe(print())
|
|
|
|
.pipe(gulp.dest(paths.dest.root))
|
|
|
|
.pipe(livereload());
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('copyHtml', () => {
|
2019-03-12 00:38:14 +00:00
|
|
|
return gulp.src(paths.src.html, { base: paths.src.root })
|
2017-09-04 02:20:56 +00:00
|
|
|
.pipe(cache('copyHtml'))
|
|
|
|
.pipe(print())
|
|
|
|
.pipe(gulp.dest(paths.dest.root))
|
|
|
|
.pipe(livereload());
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('copyFonts', () => {
|
|
|
|
return gulp.src(
|
2019-03-12 00:38:14 +00:00
|
|
|
path.join(paths.src.fonts, '**', '*.*'), { base: paths.src.root }
|
2017-09-04 02:20:56 +00:00
|
|
|
)
|
|
|
|
.pipe(cache('copyFonts'))
|
|
|
|
.pipe(print())
|
2019-03-09 02:10:23 +00:00
|
|
|
.pipe(gulp.dest(paths.dest.root))
|
2017-09-04 02:20:56 +00:00
|
|
|
.pipe(livereload());
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('copyImages', () => {
|
|
|
|
return gulp.src(
|
2019-03-12 00:38:14 +00:00
|
|
|
path.join(paths.src.images, '**', '*.*'), { base: paths.src.root }
|
2017-09-04 02:20:56 +00:00
|
|
|
)
|
|
|
|
.pipe(cache('copyImages'))
|
|
|
|
.pipe(print())
|
2019-03-09 02:10:23 +00:00
|
|
|
.pipe(gulp.dest(paths.dest.root))
|
2017-09-04 02:20:56 +00:00
|
|
|
.pipe(livereload());
|
|
|
|
});
|