1.0.6 • Published 8 years ago

broccoli-live-reload v1.0.6

Weekly downloads
28
License
ISC
Repository
github
Last release
8 years ago

Broccoli Live Reload

Serve broccoli assets with watch rebuilding and live reload capabilities.

Tracks file diffs to prevent unnecessary reloading of the browser when unnecessary.

Not recommended for production use.

Version npmSupport via GratipayNPM DownloadsBuild StatusDependencies

Install

NPM

Documentation

LiveReload(options)

port {Number}

Optional. Default is 35729

path {String}

Optional. Default is 'assets'. This is the path that you're mounting broccoli live reload onto, and is used to normalize paths to match their respective urls.

  • include {Array}

Optional. If set, defines a set of patterns to match files against for tracking inclusion. This does not affect your build itself, and can be used to speed up tracking or to otherwise prevent changes from forcing reloads. For example, if you're using a css-preprocessor, you should omit your input files from tracking to prevent their changes from forcing reloads. This allows for live reload to hot-swap styling without refreshing the page, so long as the only tracked files that changed are CSS.

if (~process.argv.indexOf('--broccoli')) {
  app.use('/assets', require('broccoli-live-reload')({
    path: 'assets',
    include: [
      '**/*.js',
      '**/*.css' // We don't want SCSS/LESS to accidentally trigger a reload
    ]
  }));
} else {
  app.use('/assets', express.static('../public'));
}
  • exclude {Array}

Optional. If set, defines a set of patterns to match files against for tracking exclusion. This does not affect your build itself, and can be used to speed up tracking or to otherwise prevent changes from forcing reloads.

if (~process.argv.indexOf('--broccoli')) {
  app.use('/assets', require('broccoli-live-reload')({
    path: 'assets',
    exclude: [
      '**/*.swf', // Larger files are slower to track. This wouldn't matter unless your HD performance is slow, and there are many large files
      '**/*.png',
      '**/*.jpg'
    ]
  }));
} else {
  app.use('/assets', express.static('../public'));
}

Donations

Care to show your appreciation? Donations are much appreciated!

1.0.6

8 years ago

1.0.5

8 years ago

1.0.5-1

8 years ago

1.0.5-0

8 years ago

1.0.4

8 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago