# ember-cli-inject-live-reload

> Plugin for ember-cli that injects live-reload script into HTML content.

Latest version **2.1.0** (published 2021-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-cli-inject-live-reload
pnpm add ember-cli-inject-live-reload
yarn add ember-cli-inject-live-reload
bun add ember-cli-inject-live-reload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2021-06-14 |
| First published | 2014-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.* \|\| 8.* \|\| >= 10.* |
| Dependencies | 2 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Robert Jackson |
| Maintainers | rwjblue, turbo87, stefanpenner |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-cli-inject-live-reload
- Repository: https://github.com/rwjblue/ember-cli-inject-live-reload
- Issues: https://github.com/rwjblue/ember-cli-inject-live-reload/issues
- npm.io page: https://npm.io/package/ember-cli-inject-live-reload

## Dependencies (2)

- [clean-base-url](https://npm.io/package/clean-base-url.md) ^1.0.0
- [ember-cli-version-checker](https://npm.io/package/ember-cli-version-checker.md) ^3.1.3

## Recent versions

- 2.1.0 (latest) — 2021-06-14
- 2.0.2 — 2019-10-08
- 1.10.2 — 2018-10-15
- 2.0.1 — 2018-10-15
- 2.0.0 — 2018-10-15
- 1.10.1 — 2018-10-13
- 1.10.0 — 2018-10-13
- 1.8.2 — 2018-08-03
- 1.8.1 — 2018-07-24
- 1.8.0 — 2018-07-24
- 1.7.0 — 2017-07-14
- 1.6.1 — 2017-01-19
- 1.6.0 — 2017-01-19
- 1.5.0 — 2017-01-19
- 1.4.1 — 2016-07-18
- … 12 more at https://npm.io/package/ember-cli-inject-live-reload/versions

## README

# ember-cli-inject-live-reload

Plugin for ember-cli that injects live-reload script into HTML content.

## Overview

This plugin injects a script tag to load `ember-cli-live-reload.js` in the head of your application's html.

The contents of `ember-cli-live-reload.js` are dynamically generated to configure and inject `livereload.js`, which is served by Ember CLI courtesy of its `tiny-lr` dependency.

`livereload.js` initiates a websocket connection back to Ember CLI. This allows Ember CLI to notify the browser to trigger a refresh after JavaScript or style changes.

## Configuration

For vanilla Ember CLI apps, no configuration is required.

The following options are supported via command line arguments or the `.ember-cli` file:

|Option|Purpose|
|------|-------|
| `liveReload` | Defaults to `true` during `ember serve`. Set to `false` to prevent the livereload script tag from being injected. |
| `liveReloadPort` | Specifies the port that `ember-cli-live-reload.js` and `livereload.js` are loaded from  |
| `liveReloadHost` | The host that `ember-cli-live-reload.js` will be loaded from |
| `liveReloadPrefix` | The url prefix which will be prepended before `livereload.js` |

The following options are supported via the `.ember-cli` file:

|Option|Purpose|
|------|-------|
| `liveReloadJsUrl` | The absolute URL used to load `livereload.js`. If specified, this overrides the `liveReloadPort` option.  |
| `liveReloadOptions` | JavaScript object for LiveReload options. LiveReload supports a number of [options](https://github.com/livereload/livereload-js#options) for configuring websocket communication, including `https`, `host`, `port`, and others. See advanced example below. |

## Advanced Example Configuration

**NOTE:** Most apps will be fine with _no_ special configuration. Only use this sort of configuration if you have reason to override the default LiveReload websocket behavior. A use case for this is serving Ember CLI apps in development via a reverse proxy such as nginx.

##### .ember-cli

```javascript
{
  "liveReloadPort": 37531,

  // This `liveReloadOptions` property becomes `window.LiveReloadOptions`
  "liveReloadOptions": {
    "port": 37631,
    "https": true,
    "host": "your-hostname.dev"
  },

  "liveReloadJsUrl": "https://your-hostname.dev/livereload.js"
}
```

---
_Source: https://npm.io/package/ember-cli-inject-live-reload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
