#32 Added html copy task to gulpfile

This commit is contained in:
Serraniel 2020-11-02 18:42:50 +01:00
parent 448cc3ecb6
commit 74f48818e4
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -147,6 +147,16 @@ gulp.task('images', () => {
.pipe(gulp.dest(tmp.images)) .pipe(gulp.dest(tmp.images))
}) })
gulp.task('html', () => {
return gulp.src(`${src.html}/**/*`)
.pipe($.plumber())
// any steps for HTML processing?
.pipe($.size({
showFiles: true,
}))
.pipe(gulp.dest(tmp.html))
})
gulp.task('manifests', () => { gulp.task('manifests', () => {
const templateFile = `${src.manifests}/manifest.template.json`; const templateFile = `${src.manifests}/manifest.template.json`;
@ -179,6 +189,8 @@ gulp.task('watch', (done) => {
gulp.watch(`${src.images}/**/*`, gulp.series('clean:build', 'images', 'dist:copy', 'dist:zip')) gulp.watch(`${src.images}/**/*`, gulp.series('clean:build', 'images', 'dist:copy', 'dist:zip'))
gulp.watch(`${src.html}/**/*`, gulp.series('clean:build', 'html', 'dist:copy', 'dist:zip'))
gulp.watch(`${src.manifests}/**/*.*`, gulp.series('clean:build', 'manifests', 'dist:copy', 'dist:zip')) gulp.watch(`${src.manifests}/**/*.*`, gulp.series('clean:build', 'manifests', 'dist:copy', 'dist:zip'))
done(); done();
@ -198,7 +210,7 @@ gulp.task('clean', gulp.series('clean:build', 'clean:dist'))
BUILD CLEAN ALL BUILD CLEAN ALL
============================================================================ */ ============================================================================ */
gulp.task('build', gulp.series('manifests', 'images', 'scripts', 'styles')); gulp.task('build', gulp.series('manifests', 'images', 'scripts', 'styles', 'html'));
gulp.task('build:clean', gulp.series('clean:build', 'manifests', 'images', 'scripts', 'styles')); gulp.task('build:clean', gulp.series('clean:build', 'manifests', 'images', 'scripts', 'styles'));
@ -220,6 +232,10 @@ gulp.task('dist:chrome', (done) => {
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
.pipe(gulp.dest(dist.chrome.styles)), .pipe(gulp.dest(dist.chrome.styles)),
// copy html
gulp.src(`${tmp.html}/*.html`)
.pipe(gulp.dest(dist.chrome.html)),
gulp.src(`${tmp.manifests}/chrome*`) gulp.src(`${tmp.manifests}/chrome*`)
.pipe($.rename('manifest.json')) .pipe($.rename('manifest.json'))
.pipe(gulp.dest(dist.chrome.root)) .pipe(gulp.dest(dist.chrome.root))
@ -240,6 +256,10 @@ gulp.task('dist:firefox', (done) => {
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
.pipe(gulp.dest(dist.firefox.styles)), .pipe(gulp.dest(dist.firefox.styles)),
// copy html
gulp.src(`${tmp.html}/*.html`)
.pipe(gulp.dest(dist.firefox.html)),
gulp.src(`${tmp.manifests}/firefox*`) gulp.src(`${tmp.manifests}/firefox*`)
.pipe($.rename('manifest.json')) .pipe($.rename('manifest.json'))
.pipe(gulp.dest(dist.firefox.root)) .pipe(gulp.dest(dist.firefox.root))
@ -260,6 +280,10 @@ gulp.task('dist:opera', (done) => {
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
.pipe(gulp.dest(dist.opera.styles)), .pipe(gulp.dest(dist.opera.styles)),
// copy html
gulp.src(`${tmp.html}/*.html`)
.pipe(gulp.dest(dist.opera.html)),
gulp.src(`${tmp.manifests}/opera*`) gulp.src(`${tmp.manifests}/opera*`)
.pipe($.rename('manifest.json')) .pipe($.rename('manifest.json'))
.pipe(gulp.dest(dist.opera.root)) .pipe(gulp.dest(dist.opera.root))