Skip to content

Instantly share code, notes, and snippets.

@michaeltroy
Created June 8, 2014 09:11
Show Gist options
  • Save michaeltroy/4f56e6de93e7efb29c84 to your computer and use it in GitHub Desktop.
Save michaeltroy/4f56e6de93e7efb29c84 to your computer and use it in GitHub Desktop.
/*
* Require our plugins.
*/
var gulp = require('gulp'),
debug = require('gulp-debug'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
component = require('gulp-component')
/**
* Paths
*/
var paths = {
scripts: ['component.json', 'src/**/*.js'],
styles: ['component.json', 'src/**/*.css']
};
/*
* Gather all the tasks and run default.
*/
gulp.task('default', ['clean'], function() {
gulp.start('styles', 'scripts');
});
/*
* Task: Clean.
*/
gulp.task('clean', function() {
return gulp.src('src/build/',
{read: false})
.pipe(clean());
});
/*
* Task: Javascript.
*/
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(component.scripts({
standalone: true
}))
//.pipe(uglify())
.pipe(gulp.dest('src/build/'))
.pipe(notify({ message: 'Scripts task complete' }));
});
/*
* TaskJavascript lint.
*/
gulp.task('lint', function() {
return gulp.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
/*
* Task: Styles.
*/
gulp.task('styles', function() {
return gulp.src(paths.styles)
.pipe(component.styles({
standalone: true
}))
.pipe(gulp.dest('src/build/'))
.pipe(notify({ message: 'Styles task complete' }));
});
gulp.task('watch', function () {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.scripts, ['styles']);
})
{
"name": "content",
"version": "0.0.0",
"private": true,
"dependencies": {},
"devDependencies": {
"gulp": "^3.6.2",
"gulp-rename": "^1.2.0",
"gulp-css-rebase-urls": "0.0.5",
"gulp-clean": "^0.3.0",
"gulp-ruby-sass": "^0.5.0",
"gulp-concat": "^2.2.0",
"gulp-autoprefixer": "^0.0.7",
"gulp-minify-css": "^0.3.4",
"gulp-uglify": "^0.3.0",
"gulp-notify": "^1.3.0",
"gulp-cache": "^0.1.11",
"gulp-jshint": "^1.6.1",
"gulp-livereload": "^1.5.0",
"gulp-shell": "^0.2.5",
"gulp-component": "^0.1.8",
"gulp-debug": "^0.3.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment