Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please update docs with examples for gulp 4 #263

Open
johnybrownalreadytaken opened this issue Feb 25, 2019 · 1 comment
Open

please update docs with examples for gulp 4 #263

johnybrownalreadytaken opened this issue Feb 25, 2019 · 1 comment

Comments

@johnybrownalreadytaken
Copy link

all in the title

@filefi
Copy link

filefi commented Jun 14, 2021

An example as follow:

const gulp = require('gulp');
const connect = require('gulp-connect')


function serve(){
    const options={
        port:8080, 
        livereload:true,
    };
    connect.server(options);
}


function html(){
    return gulp.src('./src/html/*.html')
        .pipe(gulp.dest('./dist'))
        .pipe(connect.reload()
}

function css(){
    return gulp.src('./src/css/*.css')
        .pipe(gulp.dest('./dist/css'))
        .pipe(connect.reload())
}


function js(){
    return gulp.src('./src/js/*.js')
        .pipe(gulp.dest('./dist/js'))
        .pipe(connect.reload())
}


function watch(){
    gulp.watch('./src/html/*.html',html);
    gulp.watch('./src/css/*.css',css);
    gulp.watch('./src/js/*.js',js);
}


exports.default = gulp.series(html, css, js, gulp.parallel(watch,serve));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants