From d433ac994f4a25cbac913ea8528029c33af06da1 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 29 Apr 2021 12:49:10 +0200 Subject: Electron 12 and nodejs 14 support (#1308) --- gulpfile.babel.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'gulpfile.babel.js') diff --git a/gulpfile.babel.js b/gulpfile.babel.js index d3d6a931d..6a788a9ae 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -7,7 +7,7 @@ import csso from 'gulp-csso'; import terser from 'terser'; import composer from 'gulp-uglify/composer'; import htmlMin from 'gulp-htmlmin'; -import server from 'gulp-server-livereload'; +import connect from 'gulp-connect'; import { exec } from 'child_process'; import dotenv from 'dotenv'; import sassVariables from 'gulp-sass-variables'; @@ -138,7 +138,8 @@ export function html() { collapseWhitespace: true, removeComments: true }))) - .pipe(gulp.dest(paths.html.dest)); + .pipe(gulp.dest(paths.html.dest)) + .pipe(connect.reload()); } export function styles() { @@ -165,7 +166,8 @@ export function styles() { .pipe((gulpIf(process.env.NODE_ENV !== 'development', csso({ // Only minify in production to speed up dev builds restructure: false, // Don't restructure CSS, otherwise it will break the styles })))) - .pipe(gulp.dest(paths.styles.dest)); + .pipe(gulp.dest(paths.styles.dest)) + .pipe(connect.reload()); } export function verticalStyle() { @@ -192,7 +194,8 @@ export function verticalStyle() { .pipe((gulpIf(process.env.NODE_ENV !== 'development', csso({ // Only minify in production to speed up dev builds restructure: false, // Don't restructure CSS, otherwise it will break the styles })))) - .pipe(gulp.dest(paths.verticalStyle.dest)); + .pipe(gulp.dest(paths.verticalStyle.dest)) + .pipe(connect.reload()); } export function scripts() { @@ -204,7 +207,8 @@ export function scripts() { }), ) .pipe(gulpIf(process.env.NODE_ENV !== 'development', uglify())) // Only uglify in production to speed up dev builds - .pipe(gulp.dest(paths.scripts.dest)); + .pipe(gulp.dest(paths.scripts.dest)) + .pipe(connect.reload()); } export function watch() { @@ -218,11 +222,10 @@ export function watch() { } export function webserver() { - gulp.src([paths.dest]).pipe( - server({ - livereload: true, - }), - ); + connect.server({ + root: paths.dest, + livereload: true + }); } export function recipes() { -- cgit v1.2.3-54-g00ecf