Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload browser when a new file is added in a watched directory #1291

Closed
2 of 10 tasks
thejohnfreeman opened this issue Jan 11, 2017 · 1 comment
Closed
2 of 10 tasks

Comments

@thejohnfreeman
Copy link

thejohnfreeman commented Jan 11, 2017

Issue details

BrowserSync will not reload the browser when a new file is added in a source directory, but it will reload on subsequent changes to that new file. I suspect BrowserSync is watching only the 'change' event from chokidar, and not the 'add' event, but I have not investigated at all.

Steps to reproduce/test case

$ mkdir source
$ npm start & # start browser-sync
$ touch source/index.js # nothing happens
$ touch source/index.js # browser reloads

Please specify which version of Browsersync, node and npm you're running

  • Browsersync 2.18.6
  • Node 6.9.4
  • Npm 3.10.10

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

If CLI, please paste the entire command below

browser-sync start --config browser-sync.config.js

// browser-sync.config.js
module.exports = {
  "server": true,
  "serveStatic": ["source"],
  "files": ["source"],
  // I have also tried source/**
}

Related: #93

@shakyShane
Copy link
Contributor

@thejohnfreeman Adding watchEvents in the next release, so the following will work

module.exports = {
  "server": true,
  "serveStatic": ["source"],
  "files": ["source"],
  "watchEvents": ["add", "change"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants