forked from NBoychev/wp-gulp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8899846
Showing
6 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Gulp Task Runner | ||
|
||
## Tips: | ||
Use bash terminal (default terminal on OSX and Linux, [GitBash](http://git-scm.com/downloads) on Windows). | ||
|
||
## Dependencies: | ||
|
||
1. Latest version of [NodeJS](http://nodejs.org/) (min v6.0.0) | ||
|
||
|
||
## Install: | ||
|
||
In the directory of the project: | ||
|
||
``` | ||
npm install --global gulp-cli | ||
npm install | ||
``` | ||
|
||
## Development: | ||
|
||
``` | ||
gulp | ||
``` | ||
|
||
## Build: | ||
|
||
``` | ||
gulp build | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
var gulp = require('gulp'); | ||
var sourcemaps = require('gulp-sourcemaps'); | ||
var sass = require('gulp-sass'); | ||
var autoprefixer = require('gulp-autoprefixer'); | ||
var cleanCSS = require('gulp-clean-css'); | ||
var concat = require('gulp-concat'); | ||
var uglify = require('gulp-uglify'); | ||
|
||
|
||
// SASS task | ||
gulp.task('sass', function() { | ||
gulp.src(['./src/sass/app.scss']) | ||
|
||
// Initialize the sourcemap | ||
.pipe(sourcemaps.init()) | ||
|
||
// Compile SASS | ||
.pipe(sass().on('error', sass.logError)) | ||
|
||
// Add vendor prefixes | ||
.pipe(autoprefixer({ | ||
browsers: ['last 5 versions'], | ||
cascade: false | ||
})) | ||
|
||
// Minify CSS | ||
.pipe(cleanCSS()) | ||
|
||
// Write the sourcemap | ||
.pipe(sourcemaps.write()) | ||
|
||
// Save the processed css to file | ||
.pipe(gulp.dest('./assets/css')); | ||
}); | ||
|
||
|
||
// SASS Watch task | ||
gulp.task('sass:watch', function() { | ||
gulp.watch(['./src/sass/**/*.scss'], ['sass']); | ||
}); | ||
|
||
|
||
// JS task | ||
gulp.task('js', function() { | ||
gulp.src([ | ||
'./src/js/modules/**/*.js', | ||
'./src/js/app.js' | ||
]) | ||
|
||
// Concat JS | ||
.pipe(concat('app.js')) | ||
|
||
// Minify JS | ||
.pipe(uglify()) | ||
|
||
// Save the processed js to file | ||
.pipe(gulp.dest('./assets/js')) | ||
}) | ||
|
||
|
||
// JS Watch task | ||
gulp.task('js:watch', function() { | ||
gulp.watch(['./src/js/**/*.js'], ['js']); | ||
}); | ||
|
||
|
||
// Serve task | ||
gulp.task('serve', ['sass', 'sass:watch', 'js', 'js:watch']); | ||
|
||
|
||
// Build task | ||
gulp.task('build', ['sass', 'js']); | ||
|
||
|
||
// Default task (used for fallback, when running gulp, without task specified.) | ||
gulp.task('default', ['serve']); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "custom-wp-theme", | ||
"version": "1.0.0", | ||
"description": "Custom WordPress Theme", | ||
"main": "", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"gulp": "^3.9.1", | ||
"gulp-autoprefixer": "^3.1.1", | ||
"gulp-clean-css": "^2.3.2", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-sass": "^3.1.0", | ||
"gulp-sourcemaps": "^2.4.0", | ||
"gulp-uglify": "^2.0.1" | ||
} | ||
} |
Empty file.
Empty file.