Created
July 6, 2017 11:00
-
-
Save ruman/9365c67771040f9567a6f3aa62845739 to your computer and use it in GitHub Desktop.
This file contains 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'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
concat = require('gulp-concat'), | |
notify = require('gulp-notify'), | |
cache = require('gulp-cache'), | |
// Requires the gulp-sass plugin | |
sass = require('gulp-sass'), | |
cssnano = require('gulp-cssnano'); | |
gulp.task('sass', function(){ | |
return gulp.src('public/css/*.scss') | |
.pipe(sass()) // Converts Sass to CSS with gulp-sass | |
.pipe(cssnano()) | |
.pipe(gulp.dest('wp-content/themes/onerooftop/assets/css')) | |
.pipe(notify({ message: 'Styles task complete' })) | |
}); | |
// Concatenate & Minify JS | |
gulp.task('scripts', function() { | |
return gulp.src('public/js/*.js') | |
.pipe(concat('site.js')) | |
.pipe(gulp.dest('dist')) | |
.pipe(rename('site.min.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('dist')); | |
}); | |
// gulp.task('minifiedcss', function(){ | |
// return gulp.src('public/css/*.css') | |
// .pipe(cssnano()) | |
// .pipe(gulp.dest('public/css/styles.min.css')) | |
// }) | |
gulp.task('watch', function(){ | |
// gulp.watch('public/css/*.scss', ['sass']); | |
//Js watch | |
gulp.watch('public/js/*.js', ['scripts']); | |
}); |
This file contains 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
{ | |
"name": "onerooftop", | |
"version": "0.0.0", | |
"description": "Free Kids ID", | |
"main": "public.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Mahbubur Rahman", | |
"license": "BSD-2", | |
"devDependencies": { | |
"gulp": "~3.9.1", | |
"gulp-sass": "^3.1.0", | |
"gulp-cache": "~0.2.4", | |
"gulp-concat": "~2.4.2", | |
"gulp-jshint": "~1.9.0", | |
"gulp-notify": "~2.0.1", | |
"gulp-rename": "~1.2.0", | |
"gulp-uglify": "~1.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment