Skip to content

Instantly share code, notes, and snippets.

@JohnLauber
Last active August 29, 2015 14:13
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 JohnLauber/d1b3e6768f2638036a85 to your computer and use it in GitHub Desktop.
Save JohnLauber/d1b3e6768f2638036a85 to your computer and use it in GitHub Desktop.
My GruntFile.js setup for BrowserSync. I turn off ghost mode for independent play on various devices. Also since I had issues with iPhone connecting to my server I added a named tunnel.
browserSync: {
dev: {
bsFiles: {
src : 'style.css'
},
options: {
proxy: "local.testing.dev",
ghostmode: false,
port: 8080,
tunnel: "testing", // < Used for iPhone testing
watchTask: true // < VERY important
}
}
}
//The "end" of my gruntfile config looks like this
grunt.loadNpmTasks('grunt-browser-sync');
// register task - Note you HAVE to add browserSync before watch
grunt.registerTask('default', ['browserSync', 'sass', 'uglify', 'imagemin', 'autoprefixer','watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment