-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull in updated build script, and move theme back into root.
- Loading branch information
Showing
85 changed files
with
631 additions
and
2,678 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
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,85 @@ | ||
/* browserify task | ||
--------------- | ||
Bundle javascripty things with browserify! | ||
This task is set up to generate multiple separate bundles, from | ||
different sources, and to use Watchify when run from the default task. | ||
See browserify.bundleConfigs in gulp/config.js | ||
*/ | ||
|
||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var source = require('vinyl-source-stream'); | ||
var watchify = require('watchify'); | ||
var bundleLogger = require('../util/bundleLogger'); | ||
var handleErrors = require('../util/handleErrors'); | ||
var config = require('../config').browserify; | ||
|
||
|
||
var browserifyTask = function(callback, devMode) { | ||
|
||
var bundleQueue = config.bundleConfigs.length; | ||
|
||
var browserifyThis = function(bundleConfig) { | ||
|
||
var bundler = browserify({ | ||
// Required watchify args | ||
cache: {}, packageCache: {}, fullPaths: false, | ||
// Specify the entry point of your app | ||
entries: bundleConfig.entries, | ||
// Add file extentions to make optional in your requires | ||
extensions: config.extensions, | ||
// Enable source maps! | ||
debug: config.debug | ||
}); | ||
|
||
var bundle = function() { | ||
// Log when bundling starts | ||
bundleLogger.start(bundleConfig.outputName); | ||
|
||
return bundler | ||
.bundle() | ||
// Report compile errors | ||
.on('error', handleErrors) | ||
// Use vinyl-source-stream to make the | ||
// stream gulp compatible. Specifiy the | ||
// desired output filename here. | ||
.pipe(source(bundleConfig.outputName)) | ||
// Specify the output destination | ||
.pipe(gulp.dest(bundleConfig.dest)) | ||
.on('end', reportFinished); | ||
}; | ||
|
||
if(global.isWatching) { | ||
// Wrap with watchify and rebundle on changes | ||
bundler = watchify(bundler); | ||
// Rebundle on update | ||
bundler.on('update', bundle); | ||
} | ||
|
||
var reportFinished = function() { | ||
// Log when bundling completes | ||
bundleLogger.end(bundleConfig.outputName) | ||
|
||
if(bundleQueue) { | ||
bundleQueue--; | ||
if(bundleQueue === 0) { | ||
// If queue is empty, tell gulp the task is complete. | ||
// https://github.com/gulpjs/gulp/blob/master/docs/API.md#accept-a-callback | ||
callback(); | ||
} | ||
} | ||
}; | ||
|
||
return bundle(); | ||
}; | ||
|
||
// Start bundling with Browserify for each bundleConfig specified | ||
config.bundleConfigs.forEach(browserifyThis); | ||
}; | ||
|
||
gulp.task('browserify', browserifyTask); | ||
|
||
// Exporting the task so we can call it directly in our watch task, with the 'devMode' option | ||
module.exports = browserifyTask |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('default', ['sass', 'images', 'sprites', 'watch']); | ||
gulp.task('default', ['symbols', 'sass', 'images', 'sprites', 'watch']); |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
var changed = require('gulp-changed'), | ||
gulp = require('gulp'), | ||
imagemin = require('gulp-imagemin'), | ||
config = require('../config').images, | ||
livereload = require('gulp-livereload'); | ||
var changed = require('gulp-changed'), | ||
gulp = require('gulp'), | ||
imagemin = require('gulp-imagemin'), | ||
config = require('../config').images, | ||
livereload = require('gulp-livereload'); | ||
|
||
gulp.task('images', function() { | ||
return gulp.src(config.src) | ||
.pipe(changed(config.dest)) // Ignore unchanged files | ||
.pipe(imagemin()) // Optimize | ||
.pipe(changed(config.dest)) | ||
.pipe(imagemin()) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(livereload()); | ||
}); |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
var gulp = require('gulp'), | ||
config = require('../config').production, | ||
minifyCSS = require('gulp-minify-css'), | ||
size = require('gulp-filesize'); | ||
size = require('gulp-filesize'), | ||
combineMQ = require('gulp-combine-mq'); | ||
|
||
gulp.task('minifyCss', ['sass'], function() { | ||
return gulp.src(config.cssSrc) | ||
.pipe(minifyCSS({keepBreaks:true})) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(combineMQ()) | ||
.pipe(minifyCSS({advanced:false})) | ||
.pipe(gulp.dest(config.cssDest)) | ||
.pipe(size()); | ||
}) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var gulp = require('gulp'); | ||
|
||
// Run this to compress all the things! | ||
gulp.task('production', ['images', 'minifyCss', 'uglifyJs']); | ||
gulp.task('production', ['minifyCss', 'uglifyJs']); |
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
var gulp = require('gulp'), | ||
livereload = require('gulp-livereload'), | ||
sass = require('gulp-ruby-sass'), | ||
sourcemaps = require('gulp-sourcemaps'), | ||
gulpFilter = require('gulp-filter'), | ||
handleErrors = require('../util/handleErrors'), | ||
config = require('../config').sass, | ||
autoprefixer = require('gulp-autoprefixer'); | ||
config = require('../config'), | ||
autoprefixer = require('gulp-autoprefixer'), | ||
livereload = require('gulp-livereload'); | ||
|
||
gulp.task('sass', function () { | ||
return gulp.src(config.src) | ||
return gulp.src(config.sass.src) | ||
.pipe(sourcemaps.init()) | ||
.pipe(sass(config.settings)) | ||
.pipe(sass(config.sass.settings)) | ||
.on('error', handleErrors) | ||
.pipe(sourcemaps.write()) | ||
.pipe(autoprefixer({ browsers: ['last 2 version'] })) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(gulp.dest(config.sass.dest)) | ||
.pipe(livereload()); | ||
}); | ||
|
||
//.pipe(autoprefixer(config.autoprefixer)) |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
var gulp = require('gulp'), | ||
config = require('../config').sprite, | ||
sprite = require('css-sprite').stream, | ||
gulpif = require('gulp-if'); | ||
var gulp = require('gulp'), | ||
config = require('../config').sprites, | ||
sprite = require('css-sprite').stream, | ||
gulpif = require('gulp-if'), | ||
livereload = require('gulp-livereload'); | ||
|
||
gulp.task('sprites', function() { | ||
return gulp.src(config.src) | ||
.pipe(sprite(config.settings)) | ||
.pipe(gulpif('*.png', gulp.dest(config.dest_img))) | ||
.pipe(gulpif('*.scss', gulp.dest(config.dest_sass))); | ||
.pipe(gulpif('*.png', gulp.dest(config.destSprites))) | ||
.pipe(gulpif('*.sass', gulp.dest(config.destSass))) | ||
.pipe(gulpif('*.scss', gulp.dest(config.destSass))) | ||
.pipe(livereload()); | ||
}); |
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,44 @@ | ||
var gulp = require('gulp'), | ||
config = require('../config').symbols, | ||
iconfont = require('gulp-iconfont'), | ||
consolidate = require('gulp-consolidate'), | ||
rename = require('gulp-rename'), | ||
livereload = require('gulp-livereload'); | ||
|
||
gulp.task('symbols', function () { | ||
return gulp.src(config.src) | ||
.pipe(iconfont(config.settings)) | ||
.on('codepoints', function(codepoints, options) { | ||
// Options for when the scss/sass files are being generated. | ||
var optionsSass = { | ||
glyphs: codepoints, | ||
fontName: 'symbols', | ||
fontPath: 'assets/fonts/symbols/', | ||
className: 'symbol' | ||
}; | ||
// Options for when the preview files are being generated. | ||
var optionsHtml = { | ||
glyphs: codepoints, | ||
fontName: 'symbols', | ||
fontPath: '', | ||
className: 'symbol' | ||
}; | ||
// Generate sass/scss file for symbols | ||
gulp.src(config.tplSass) | ||
.pipe(consolidate('lodash', optionsSass)) | ||
.pipe(rename(config.renameSass)) | ||
.pipe(gulp.dest(config.destSass)); | ||
// Generate HTML file for symbol preview | ||
gulp.src(config.tplHtml) | ||
.pipe(consolidate('lodash', optionsHtml)) | ||
.pipe(rename({ basename:'symbols' })) | ||
.pipe(gulp.dest(config.destFont)); | ||
// Generate css file for HTML preview | ||
gulp.src(config.tplCss) | ||
.pipe(consolidate('lodash', optionsHtml)) | ||
.pipe(rename({ basename:'symbols' })) | ||
.pipe(gulp.dest(config.destFont)); | ||
}) | ||
.pipe(gulp.dest(config.destFont)) | ||
.pipe(livereload()); | ||
}); |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
var gulp = require('gulp'), | ||
config = require('../config').production, | ||
size = require('gulp-filesize'), | ||
uglify = require('gulp-uglify'); | ||
var gulp = require('gulp'), | ||
config = require('../config').production, | ||
size = require('gulp-filesize'), | ||
uglify = require('gulp-uglify'); | ||
|
||
gulp.task('uglifyJs', ['browserify'], function() { | ||
return gulp.src(config.jsSrc) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(gulp.dest(config.jsDest)) | ||
.pipe(size()); | ||
}); |
Oops, something went wrong.