lib/helpers/watcher.js
function installDevelopmentWatcher (startingFolder, callback) {
  const buildFolder = config.commands.build.output

  // BrowserSync will watch for changes in the assets CSS.
  // It will also create a server with the build folder and the assets.
  bs.init({
    server: [buildFolder, assets],
    port: config.commands.build.port,
    files: path.join(assets, '**/*.css'),
    ui: false,
    open: false
  })

  // Meanwhile, the watcher will monitor changes in the templates
  // and the data files.
  // Then, when a change occurs, it will regenerate the site through
  // the provide callback.
  const templateFolder = path.join(assets, '**/*.html')
  const dataFolder = path.join(startingFolder, '**/data.xml')

  const watcher = createWatcher(templateFolder, dataFolder)

  watcher.on('change', () => {
    callback()
    bs.reload()
  })
}
function installDevelopmentWatcher (startingFolder, callback) {
  const buildFolder = config.commands.build.output

  // BrowserSync will watch for changes in the assets CSS.
  // It will also create a server with the build folder and the assets.
  bs.init({
    server: [buildFolder, assets],
    port: config.commands.build.port,
    files: path.join(assets, '**/*.css'),
    ui: false,
    open: false
  })

  // Meanwhile, the watcher will monitor changes in the templates
  // and the data files.
  // Then, when a change occurs, it will regenerate the site through
  // the provide callback.
  const templateFolder = path.join(assets, '**/*.html')
  const dataFolder = path.join(startingFolder, '**/data.xml')

  const watcher = createWatcher(templateFolder, dataFolder)

  watcher.on('change', () => {
    callback()
    bs.reload()
  })
}
function installDevelopmentWatcher ( startingFolder , callback ) { const buildFolder = config . commands . build . output // BrowserSync will watch for changes in the assets CSS. // It will also create a server with the build folder and the assets. bs . init ( { server : [ buildFolder , assets ] , port : config . commands . build . port , files : path . join ( assets , '**/*.css' ) , ui : false , open : false } ) // Meanwhile, the watcher will monitor changes in the templates // and the data files. // Then, when a change occurs, it will regenerate the site through // the provide callback. const templateFolder = path . join ( assets , '**/*.html' ) const dataFolder = path . join ( startingFolder , '**/data.xml' ) const watcher = createWatcher ( templateFolder , dataFolder ) watcher . on ( 'change' , ( ) => { callback ( ) bs . reload ( ) } ) }
Complex watcher to develop the CSS and templates of this project. Will check the data files, the templates AND the CSS.
Complex watcher to develop the CSS and templates of this project . Will check the data files the templates AND the CSS .