ember-cli-inject-live-reload

2.1.0 • Public • Published

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 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
{
  "liveReloadPort": 37531,

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

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.087,172latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.087,172
2.0.28,428
1.10.210,655
2.0.11,265
2.0.00
1.10.10
1.10.02
1.8.22,264
1.8.161
1.8.00
1.7.03,865
1.6.1847
1.6.00
1.5.00
1.4.1551
1.4.0992
1.3.1106
1.3.017
1.2.30
1.2.20
1.2.11
1.2.00
1.1.00
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i ember-cli-inject-live-reload

Weekly Downloads

116,226

Version

2.1.0

License

MIT

Unpacked Size

19.4 kB

Total Files

5

Last publish

Collaborators

  • rwjblue
  • turbo87
  • stefanpenner