Last active
February 23, 2016 18:29
-
-
Save danielpataki/f837d694d2dce6983166 to your computer and use it in GitHub Desktop.
Gulp and WordPress
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
| gulp.task('default', ['scripts', 'styles']); |
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
| npm install --global gulp-cli |
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
| npm install --save-dev gulp |
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
| npm install gulp-sass --save-dev |
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'); | |
| gulp.task('default', function() { | |
| }); |
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 sass = require('gulp-sass'); |
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
| gulp.task('sass', function () { | |
| return gulp.src('./development/styles/style.scss') | |
| .pipe(sass().on('error', sass.logError)) | |
| .pipe(minifyCss({ | |
| keepSpecialComments: 1 | |
| })) | |
| .pipe(gulp.dest('./')); | |
| }); |
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
| gulp.task('sass', function () { | |
| return gulp.src('./development/styles/style.scss') | |
| .pipe(sass().on('error', sass.logError)) | |
| .pipe(gulp.dest('./')); | |
| }); |
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
| gulp.task("scripts", function() { | |
| gulp.src(['./development/scripts/scripts.js']) | |
| .pipe( include() ) | |
| .pipe( gulp.dest("./") ) | |
| }); | |
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
| //= 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(); |
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
| /*! | |
| 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 | |
| */ |
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
| gulp.task('watch', function () { | |
| gulp.watch('./development/styles/*.scss', ['sass'] ); | |
| gulp.watch('./development/scripts/*.js', ['scripts'] ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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".