broccoli-inject-livereload
Version:
Broccoli plugin for injecting livereload script into HTML
57 lines (41 loc) • 2.37 kB
Markdown
# broccoli-inject-livereload
[](https://travis-ci.org/stfsy/broccoli-inject-livereload)
[](https://github.com/stfsy/broccoli-inject-livereload/blob/master/package.json)
[](https://github.com/stfsy/broccoli-inject-livereload/blob/master/package.json)
[](https://www.npmjs.com/package/broccoli-inject-livereload)
[](https://www.npmjs.com/package/broccoli-inject-livereload)
[](https://github.com/stfsy/broccoli-inject-livereload/releases)
[](https://github.com/stfsy/broccoli-inject-livereload/issues)
[](https://github.com/stfsy/broccoli-inject-livereload/blob/master/LICENSE)
This plugin injects a reference to the livereload script into your HTML files. Please note that the plugin will only modify files with `.html` extension that match the **target** property and simply copy everything else.
## Installation
`npm install broccoli-inject-livereload --save-dev`
## Example using a single html target
```js
const BroccoliInjectLivereload = require('broccoli-inject-livereload')
const reloadable = new BroccoliInjectLivereload('app', {
target: 'index.html'
})
module.exports = reloadable
```
## Example using a regular expression to target multiple html files
```js
const BroccoliInjectLivereload = require('broccoli-inject-livereload')
const reloadable = new BroccoliInjectLivereload('app', {
target: /^[a-zA-Z._-]+.html$/
})
module.exports = reloadable
```
## Example using a costum port
```js
const BroccoliInjectLivereload = require('broccoli-inject-livereload')
const reloadable = new BroccoliInjectLivereload('app', {
target: 'index.html',
livereload: {
port: 12345
}
})
module.exports = reloadable
```
## License
This project is distributed under the MIT license.