Skip to content

Instantly share code, notes, and snippets.

@WuglyakBolgoink
Forked from kcmr/gulpfile.js
Created May 2, 2018 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WuglyakBolgoink/3f54f9fe8a880d7c77d42e3c7c1b7dbe to your computer and use it in GitHub Desktop.
Save WuglyakBolgoink/3f54f9fe8a880d7c77d42e3c7c1b7dbe 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