Skip to content

Instantly share code, notes, and snippets.

@ShawnStringfield
Forked from kcmr/gulpfile.js
Created January 4, 2017 16:12
Show Gist options
  • Select an option

  • Save ShawnStringfield/df50439288e30cc386fad2d2515a2175 to your computer and use it in GitHub Desktop.

Select an option

Save ShawnStringfield/df50439288e30cc386fad2d2515a2175 to your computer and use it in GitHub Desktop.
Pushstate with browserSync (gulp)
var gulp = require('gulp'),
browserSync = require('browser-sync'),
historyApiFallback = require('connect-history-api-fallback');
gulp.task('serve', function() {
browserSync({
files: ['js/**/*.js', '*.html', 'css/**/*.css'],
server: {
baseDir: '.',
middleware: [ historyApiFallback() ]
}
});
});
{
"name": "browsersync-pushstate",
"devDependencies": {
"browser-sync": "^2.11.0",
"connect-history-api-fallback": "^1.1.0",
"gulp": "^3.9.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment