Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested updates to 'Browsersync + Gulp' documentation #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _src/_includes/snippets/gulp/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gulp.task('js', function () {
gulp.task('js-watch', ['js'], browserSync.reload);

// use default task to launch Browsersync and watch JS files
gulp.task('serve', ['js'], function () {
gulp.task('serve', ['js'], function (async) {

// Serve files from the root of this project
browserSync.init({
Expand Down
2 changes: 1 addition & 1 deletion _src/_includes/snippets/gulp/reload.manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var reload = browserSync.reload;
// Save a reference to the `reload` method

// Watch scss AND html files, doing different things with each.
gulp.task('serve', function () {
gulp.task('serve', function (async) {

// Serve files from the root of this project
browserSync.init({
Expand Down
4 changes: 2 additions & 2 deletions _src/_includes/snippets/gulp/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var gulp = require('gulp');
var browserSync = require('browser-sync').create();

// Static server
gulp.task('browser-sync', function() {
gulp.task('browser-sync', function(async) { // async support
browserSync.init({
server: {
baseDir: "./"
Expand All @@ -12,7 +12,7 @@ gulp.task('browser-sync', function() {

// or...

gulp.task('browser-sync', function() {
gulp.task('browser-sync', function(async) { // async support
browserSync.init({
proxy: "yourlocal.dev"
});
Expand Down
2 changes: 1 addition & 1 deletion _src/_includes/snippets/gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');

// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
gulp.task('serve', ['sass'], function(async) {

browserSync.init({
server: "./app"
Expand Down
2 changes: 1 addition & 1 deletion _src/_includes/snippets/gulp/sass.maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var sass = require("gulp-ruby-sass");
var browserSync = require("browser-sync").create();

// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
gulp.task('serve', ['sass'], function(async) {

browserSync.init({
server: "./app"
Expand Down
7 changes: 6 additions & 1 deletion _src/docs/gulp.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Then, use them within your `gulpfile.js`:

{{ hl src="snippets/gulp/require.js" }}

{{#md}}
Be sure to pass a callback to the task to ensure it [supports async](https://github.com/gulpjs/gulp/blob/master/docs/API.md#async-task-support)
so that the `browserSync` [server](/docs/options/#option-server) stays running.
{{/md}}

{{ inc src="headerlink.html" title="SASS + CSS Injecting" slug="gulp-sass-css" }}

{{#md}}
Expand Down Expand Up @@ -67,4 +72,4 @@ by wrapping it in a task. This example will compile & auto-inject CSS just as be
changed, the browsers will be reloaded instead.
{{/md}}

{{ hl src="snippets/gulp/reload.manual.js" }}
{{ hl src="snippets/gulp/reload.manual.js" }}