Created
March 6, 2016 16:34
-
-
Save mistergraphx/f1297761f1c6907a14a3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function browserSyncInit(baseDir, files) { | |
browserSync.instance = browserSync.init(files, { | |
startPath: '/', server: { baseDir: baseDir } | |
}); | |
} | |
// starts a development server | |
// runs preprocessor tasks before, | |
// and serves the src and .tmp folders | |
gulp.task( | |
'serve', | |
['typescript', 'jade', 'sass', 'inject' ], | |
function () { | |
browserSyncInit([ | |
paths.tmp | |
paths.src | |
], [ | |
paths.tmp + '/**/*.css', | |
paths.tmp + '/**/*.js', | |
paths.tmp + '/**/*.html' | |
]); | |
}); | |
// starts a production server | |
// runs the build task before, | |
// and serves the dist folder | |
gulp.task('serve:dist', ['build'], function () { | |
browserSyncInit(paths.dist); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment