Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const del = require('del');
- const gulp = require('gulp');
- const elm = require('gulp-elm');
- const connect = require('gulp-connect');
- const plumber = require('gulp-plumber');
- const paths = {
- dest: 'dist',
- elm: 'src/**/*.elm',
- static: 'src/**/*.{html,css}',
- }
- gulp.task('clean', (cb) => del([paths.dest], cb));
- gulp.task('static', () => gulp
- .src(paths.static)
- .pipe(plumber())
- .pipe(gulp.dest(paths.dest))
- .pipe(connect.reload())
- );
- gulp.task('elm-init', elm.init);
- gulp.task('elm', ['elm-init'], () => gulp
- .src(paths.elm)
- .pipe(plumber())
- .pipe(elm())
- .pipe(gulp.dest(paths.dest))
- .pipe(connect.reload())
- );
- gulp.task('connect', () => {
- connect.server({
- root: paths.dest,
- livereload: true
- })
- });
- gulp.task('watch', () => {
- gulp.watch(paths.elm, ['elm'])
- gulp.watch(paths.static, ['static'])
- })
- gulp.task('build', ['static', 'elm']);
- gulp.task('dev', ['build', 'connect', 'watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement