Last active
September 12, 2019 19:14
-
-
Save KimJoyFox/dd1d0e8fe975b1a195c30f08ae03f62d to your computer and use it in GitHub Desktop.
Starter Gulp.js File
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
| var gulp = require('gulp'); | |
| var sass = require('gulp-sass'); | |
| var cleanCSS = require('gulp-clean-css'); | |
| var minify = require('gulp-minify'); | |
| var concat = require('gulp-concat'); | |
| gulp.task('styles', function() { | |
| gulp.src('wp-content/themes/themename/assets/sass/style.scss') | |
| .pipe(sass().on('error', sass.logError)) | |
| .pipe(cleanCSS()) | |
| .pipe(gulp.dest('wp-content/themes/themename/assets/css/')); | |
| }); | |
| gulp.task('scripts', function() { | |
| return gulp.src([ | |
| '!wp-content/themes/themename/assets/js/all.js', | |
| '!wp-content/themes/themename/assets/js/all-min.js', | |
| 'wp-content/themes/themename/assets/js/*.js']) | |
| .pipe(concat({ path: 'all.js'})) | |
| .pipe(minify({ | |
| ext:{ | |
| src:'.js', | |
| min:'-min.js' | |
| }, | |
| })) | |
| .pipe(gulp.dest('wp-content/themes/themename/assets/js/')); | |
| }); | |
| gulp.task('watch',function() { | |
| gulp.watch('wp-content/themes/themename/assets/sass/*.scss',['styles']); | |
| gulp.watch('wp-content/themes/themename/assets/js/*.js',['scripts']); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment