Files
com_sportsmanager/gulpfile.babel.js/tasks/copy-release.js
Niels Nübel 3d59b14405 init
2020-12-04 11:11:35 +01:00

34 lines
818 B
JavaScript

/*
* @title Copy
* @description A task to copy files to the output directory
*/
// Dependencies
import {src, dest, series} from 'gulp';
import changed from 'gulp-changed';
import replacestrings from '../util/replaceStrings.js';
import gulpif from 'gulp-if';
// Config
import {config, isProd, stringsreplace} from '../config';
function cleancopy() {
return src(config.paths.copyrelease.src)
.pipe(gulpif(!isProd, changed(config.paths.copyrelease.dest)))
.pipe(dest(config.paths.copyrelease.dest));
}
function replacecopy() {
return src(config.paths.copyrelease.replacesrc)
.pipe(replacestrings(stringsreplace))
.pipe(gulpif(!isProd, changed(config.paths.copyrelease.dest)))
.pipe(dest(config.paths.copyrelease.dest));
}
export const copyRelease = series(
cleancopy,
replacecopy
);