Skip to content

Instantly share code, notes, and snippets.

@kcmr
Created January 9, 2016 17:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kcmr/eba67564af1a72baa19c to your computer and use it in GitHub Desktop.
Save kcmr/eba67564af1a72baa19c 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"
}
}
@poillic
Copy link

poillic commented Apr 16, 2018

Hi I tried your solution to fix the pushState issue https://github.com/poillic/browsersync-history/blob/master/gulpfile.js but I doesn't work. Did you made something more ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment