Created
December 17, 2019 20:19
-
-
Save marwinious/9114068277b41b1134f8cbec061bcfd9 to your computer and use it in GitHub Desktop.
Local inline project sample gulpfile.js
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 characters
| const { series, src, dest, watch } = require('gulp'); | |
| const babel = require('gulp-babel'); | |
| const rename = require('gulp-rename'); | |
| const uglify = require('gulp-uglify'); | |
| const concat = require('gulp-concat'); | |
| const sass = require('gulp-sass'); | |
| const cleanCSS = require('gulp-clean-css'); | |
| function scripts() { | |
| return src([ | |
| 'js/*.js' | |
| ]) | |
| .pipe(babel({presets: ['@babel/preset-env']})) | |
| // .pipe(concat('bulk_scripts.js')) | |
| .pipe(dest('./js/dist/')) | |
| .pipe(uglify()) | |
| .pipe(rename({suffix: '.min'})) | |
| .pipe(dest('./js/dist/')) | |
| } | |
| function scss() { | |
| return src([ | |
| 'css/*.scss' | |
| ]) | |
| .pipe(sass()) | |
| // .pipe(concat('bulk_css.css')) | |
| .pipe(dest('./css/dist/')) | |
| .pipe(cleanCSS()) | |
| .pipe(rename({suffix: '.min'})) | |
| .pipe(dest('./css/dist/')) | |
| } | |
| function watcher() { | |
| watch('js/*.js', series(scripts)); | |
| watch('css/*.scss', series(scss)); | |
| } | |
| exports.build = series(scripts, scss); | |
| exports.default = watcher; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment