Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NBoychev committed Jan 27, 2017
0 parents commit 8899846
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
30 changes: 30 additions & 0 deletions README.md
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
```
76 changes: 76 additions & 0 deletions gulpfile.js
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']);
21 changes: 21 additions & 0 deletions package.json
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 added src/js/app.js
Empty file.
Empty file added src/sass/app.scss
Empty file.

0 comments on commit 8899846

Please sign in to comment.