Skip to content

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

@thejohnfreeman

Description

@thejohnfreeman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions