Created
February 1, 2019 04:26
-
-
Save jasonyingling/d6fcd7352c47b102f895642e4b31efb7 to your computer and use it in GitHub Desktop.
Revisions
-
jasonyingling created this gist
Feb 1, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ const { src, dest, watch } = require('gulp'); const sass = require('gulp-sass'); const minifyCSS = require('gulp-csso'); const babel = require('gulp-babel'); const concat = require('gulp-concat'); const browserSync = require('browser-sync').create(); function css() { return src('./sass/*.scss', { sourcemaps: true }) .pipe(sass()) .pipe(minifyCSS()) .pipe(dest('./'), { sourcemaps: true }) .pipe(browserSync.stream()); } function js() { return src('./js/*.js', { sourcemaps: true }) .pipe(babel({ presets: ['@babel/env'] })) .pipe(concat('build.min.js')) .pipe(dest('./js/min', { sourcemaps: true })); } function browser() { browserSync.init({ proxy: 'domain.local', files: [ './**/*.php' ] }); watch('./sass/**/*.scss', css); watch('./js/*.js', js).on('change', browserSync.reload); } exports.css = css; exports.js = js; exports.default = browser;