Merge pull request #1293 from austinpray/8.0.0
Documents BrowserSync in gulpfile.
This commit is contained in:
38
gulpfile.js
38
gulpfile.js
@@ -19,22 +19,22 @@ var path = manifest.paths;
|
|||||||
var config = manifest.config || {};
|
var config = manifest.config || {};
|
||||||
|
|
||||||
// `globs` - These ultimately end up in their respective `gulp.src`.
|
// `globs` - These ultimately end up in their respective `gulp.src`.
|
||||||
// - `globs.js` - array of asset-builder js Dependency objects. Example:
|
// - `globs.js` - Array of asset-builder js Dependency objects. Example:
|
||||||
// ```
|
// ```
|
||||||
// { type: 'js', name: 'main.js', globs: [] }
|
// {type: 'js', name: 'main.js', globs: []}
|
||||||
// ```
|
// ```
|
||||||
// - `globs.css` an array of asset-builder css Dependency objects. Example:
|
// - `globs.css` - Array of asset-builder css Dependency objects. Example:
|
||||||
// ```
|
// ```
|
||||||
// { type: 'css', name: 'main.css', globs: [] }
|
// {type: 'css', name: 'main.css', globs: []}
|
||||||
// ```
|
// ```
|
||||||
// - `globs.fonts` - array of font path globs
|
// - `globs.fonts` - Array of font path globs.
|
||||||
// - `globs.images` - array of image path globs
|
// - `globs.images` - Array of image path globs.
|
||||||
// - `globs.bower` - array of all the bower main files
|
// - `globs.bower` - Array of all the bower main files.
|
||||||
var globs = manifest.globs;
|
var globs = manifest.globs;
|
||||||
|
|
||||||
// `project` - paths to first-party assets.
|
// `project` - paths to first-party assets.
|
||||||
// - `project.js` - array of first-party js assets
|
// - `project.js` - Array of first-party js assets.
|
||||||
// - `project.css` - array of first-party css assets
|
// - `project.css` - Array of first-party css assets.
|
||||||
var project = manifest.getProjectGlobs();
|
var project = manifest.getProjectGlobs();
|
||||||
|
|
||||||
// CLI options
|
// CLI options
|
||||||
@@ -136,7 +136,7 @@ var writeToManifest = function(directory) {
|
|||||||
// Run `gulp -T` for a task summary
|
// Run `gulp -T` for a task summary
|
||||||
|
|
||||||
// ### Styles
|
// ### Styles
|
||||||
// `gulp styles` - compiles, combines, and optimizes bower css and project css.
|
// `gulp styles` - Compiles, combines, and optimizes bower css and project css.
|
||||||
gulp.task('styles', function() {
|
gulp.task('styles', function() {
|
||||||
var merged = merge();
|
var merged = merge();
|
||||||
manifest.forEachDependency('css', function(dep) {
|
manifest.forEachDependency('css', function(dep) {
|
||||||
@@ -148,8 +148,8 @@ gulp.task('styles', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ### Scripts
|
// ### Scripts
|
||||||
// `gulp scripts` - runs jshint then compiles, combines, and optimizes bower
|
// `gulp scripts` - Runs jshint then compiles, combines, and optimizes bower
|
||||||
// javascript and project javascript
|
// javascript and project javascript.
|
||||||
gulp.task('scripts', ['jshint'], function() {
|
gulp.task('scripts', ['jshint'], function() {
|
||||||
var merged = merge();
|
var merged = merge();
|
||||||
manifest.forEachDependency('js', function(dep) {
|
manifest.forEachDependency('js', function(dep) {
|
||||||
@@ -163,7 +163,7 @@ gulp.task('scripts', ['jshint'], function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ### Fonts
|
// ### Fonts
|
||||||
// `gulp fonts` - grabs all the fonts and outputs them in a flattened directory
|
// `gulp fonts` - Grabs all the fonts and outputs them in a flattened directory
|
||||||
// structure. See: https://github.com/armed/gulp-flatten
|
// structure. See: https://github.com/armed/gulp-flatten
|
||||||
gulp.task('fonts', function() {
|
gulp.task('fonts', function() {
|
||||||
return gulp.src(globs.fonts)
|
return gulp.src(globs.fonts)
|
||||||
@@ -172,7 +172,7 @@ gulp.task('fonts', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ### Images
|
// ### Images
|
||||||
// `gulp images` - run lossless compression on all the images.
|
// `gulp images` - Run lossless compression on all the images.
|
||||||
gulp.task('images', function() {
|
gulp.task('images', function() {
|
||||||
return gulp.src(globs.images)
|
return gulp.src(globs.images)
|
||||||
.pipe($.imagemin({
|
.pipe($.imagemin({
|
||||||
@@ -183,7 +183,7 @@ gulp.task('images', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ### JsHint
|
// ### JsHint
|
||||||
// `gulp jshint` - lints configuration JSON and project javascript
|
// `gulp jshint` - Lints configuration JSON and project javascript.
|
||||||
gulp.task('jshint', function() {
|
gulp.task('jshint', function() {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'bower.json', 'gulpfile.js'
|
'bower.json', 'gulpfile.js'
|
||||||
@@ -194,11 +194,15 @@ gulp.task('jshint', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ### Clean
|
// ### Clean
|
||||||
// `gulp clean` - deletes the build folder entirely
|
// `gulp clean` - Deletes the build folder entirely.
|
||||||
gulp.task('clean', require('del').bind(null, [path.dist]));
|
gulp.task('clean', require('del').bind(null, [path.dist]));
|
||||||
|
|
||||||
// ### Watch
|
// ### Watch
|
||||||
// `gulp watch` - recompile assets whenever they change
|
// `gulp watch` - Use BrowserSync to proxy your dev server and synchronize code
|
||||||
|
// changes across devices. Specify the hostname of your dev server at
|
||||||
|
// `manifest.config.devUrl`. When a modification is made to an asset, run the
|
||||||
|
// build step for that asset and inject the changes into the page.
|
||||||
|
// See: http://www.browsersync.io
|
||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
browserSync({
|
browserSync({
|
||||||
proxy: config.devUrl
|
proxy: config.devUrl
|
||||||
|
|||||||
Reference in New Issue
Block a user