Skip to content

Instantly share code, notes, and snippets.

@danielpataki
Last active February 23, 2016 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpataki/f837d694d2dce6983166 to your computer and use it in GitHub Desktop.
Save danielpataki/f837d694d2dce6983166 to your computer and use it in GitHub Desktop.
Gulp and WordPress
gulp.task('default', ['scripts', 'styles']);
npm install --global gulp-cli
npm install --save-dev gulp
npm install gulp-sass --save-dev
var gulp = require('gulp');
gulp.task('default', function() {
});
var sass = require('gulp-sass');
gulp.task('sass', function () {
return gulp.src('./development/styles/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(minifyCss({
keepSpecialComments: 1
}))
.pipe(gulp.dest('./'));
});
gulp.task('sass', function () {
return gulp.src('./development/styles/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./'));
});
gulp.task("scripts", function() {
gulp.src(['./development/scripts/scripts.js'])
.pipe( include() )
.pipe( gulp.dest("./") )
});
//= include ../components/bower/fastclick/lib/fastclick.js
//= include ../components/bower/foundation/js/vendor/modernizr.js
//= include ../components/bower/foundation/js/foundation/foundation.js
//= include ../components/bower/foundation/js/foundation/foundation.reveal.js
//= include ../components/bower/foundation/js/foundation/foundation.dropdown.js
//= include ../components/bower/foundation/js/foundation/foundation.alert.js
//= include stickybar.js
jQuery(document).foundation();
/*!
Theme Name: My Theme
Theme URI: https://danielpataki.com
Author: Daniel Pataki
Author URI: https://danielpataki.com/
Description: A theme with a special comment
Version: 1.0
Text Domain: mytheme
*/
gulp.task('watch', function () {
gulp.watch('./development/styles/*.scss', ['sass'] );
gulp.watch('./development/scripts/*.js', ['scripts'] );
});
@udoyen
Copy link

udoyen commented Feb 23, 2016

I have two observations
1.) npm says this: " npm WARN deprecated gulp-minify-css@1.2.3: Please use gulp-cssnano instead".
2.) I get this error when I run gulp include: "ReferenceError: include is not defined".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment