gulp-recipe-browsersync-server
Local development and distribution testing server with all browsersync features. Provides global watch handler.
deps: preServe
Run the whole development server stack, with browsersync with all its features as a server.
Serve files from dist folder. Note that project needs to be built manually first.
deps: watch
Run all preServe hooks.
deps: clean:temp
Run all watch hooks.
Delete temp folder and its contents.
default: {}
type: object
Browsersync config options, shared between both dev and dist server.
default: {port: config.ports.dev, server: {baseDir: [config.paths.tmp, config.paths.app]}}
type: object
Browsersync config options, specific for dev server. Merged with shared config.
default: {port: config.ports.dist, server: {baseDir: config.paths.dist}}
type: object
Browsersync config options, specific for dist server. Merged with shared config.
dev specific: browserSync.dev.useHistoryApi
dist specific: browserSync.dist.useHistoryApi
Add history api handling middleware to selected environment.
mandatory
Files that will be watched for changes by browserSync. Typically should include all files that may be directly served.
example config:
sources.devAssets = [
paths.app + 'bower_components/*/*.js',
paths.app + 'bower_components/*/{dist,min,release}/*.{js,css}', // most of the generic bower modules
sources.js, // include only when serving non-processed js files
sources.css, // include only when serving non-processed css files
{ files: paths.tmp + '**/*', base: paths.tmp } // all processed files from temp directory
];
default: 'app/'
App folder path, part of default dev baseDir configuration.
default: 'tmp/'
Temp folder path, part of default dev baseDir configuration.
default: 'dist/'
Dist folder path, part of default dist baseDir configuration.
default: 3000
Default port for browserSync server. Part of default dev port configuration. Note: actual used port may be different, as browserSync performs a empty port scan.
default: 3100
Default port for browserSync server. Part of default dev port configuration. Note: actual used port may be different, as browserSync performs a empty port scan.
alias: tasks.serve
default: 'watch'
serve task name.
alias: tasks.serveDist
default: 'serve:dist'
serve:dist task name.
alias: tasks.preServe
default: 'preServe'
preServe task name.
alias: tasks.watch
default: 'watch'
watch task name.
alias: tasks.cleanTemp
default: 'clean:temp'
clean:temp task name.
Runs all hooked watch tasks before serve and preServe.
Runs all hooked preServe tasks just before server start, after watchers.
Watch source files in devAsset pipes.