Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ember-cli-inject-live-reload

rwjblue370.9kMIT2.1.0

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

ember-addon

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 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"
}

changelog

Change Log

v2.1.0 (2021-06-14)

:rocket: Enhancement

Committers: 1

v2.0.1 (2018-10-15)

:bug: Bug Fix

Committers: 2

v2.0.0 (2018-10-15)

:boom: Breaking Change

Committers: 1

v1.10.1 (2018-10-13)

:rocket: Enhancement

  • #59 package.json: Declare Node.js version requirements. (@Turbo87)

:bug: Bug Fix

  • #58 Run test suite on TravisCI and fix Node 4 compatibility. (@Turbo87)

:house: Internal

Committers: 2

v1.10.0 (2018-10-13)

:bug: Bug Fix

:house: Internal

Committers: 1

v1.8.2 (2018-08-03)

Full Changelog

Merged pull requests:

  • Passing port and host to livereload.js file as regex fails to parse URL with prefix #51 (SparshithNR)

v1.8.1 (2018-07-24)

Full Changelog

Merged pull requests:

  • fix undefined error when options.liveReloadPrefix is undefined #50 (SparshithNR)

v1.8.0 (2018-07-24)

Full Changelog

Implemented enhancements:

  • Consider liveReloadPrefix option which got added into tiny-lr #49 (SparshithNR)

v1.7.0 (2017-07-14)

Full Changelog

Fixed bugs:

  • When using the liveReloadBaseUrl with an absolute URL, the non-path portion should be stripped when setting up middleware. #36 (lukemelia)

Closed issues:

  • Is it possible to remove the need for a liveReloadPort added to the livereload url #43

v1.6.1 (2017-01-19)

Full Changelog

Closed issues:

  • Live Reload not working when not using Ember CLI server to serve assets #13

Merged pull requests:

  • Change the name of middleware to broccoli-watcher #41 (kratiahuja)

v1.6.0 (2017-01-19)

Full Changelog

Merged pull requests:

  • Update this addon to run before the new serve-file middleware #39 (kratiahuja)

v1.5.0 (2017-01-19)

Full Changelog

Closed issues:

  • Live reload on master not working (500 error) #35
  • liveReloadBaseUrl with absolute url no longer supported #33
  • Injected script not being appropriately fingerprinted #32
  • Requirements #31
  • Use EMBER\_CLI\_INJECT\_LIVE\_RELOAD\_BASEURL in the injected script #30

Merged pull requests:

v1.4.1 (2016-07-18)

Full Changelog

Closed issues:

  • baseURL is being removed from ember #27
  • [Question]: starting point to hot reload JS like we do w/ css today? #26
  • Livereload reloads whole page even if only the css has changed #11

Merged pull requests:

v1.4.0 (2015-12-08)

Full Changelog

Merged pull requests:

v1.3.1 (2015-01-30)

Full Changelog

Closed issues:

  • Where can I find ember-cli-live-reload.js #16
  • live-reload does not work if rootURL is a subdirectory #15

Merged pull requests:

  • Add baseUrl to script path for ember-cli-live-reload.js #18 (pixelhandler)
  • connect-livereload dependency is not required anymore #17 (Dremora)
  • Wrap dynamic script to avoid globals #12 (teddyzeenny)

v1.3.0 (2014-10-13)

Full Changelog

Closed issues:

  • Support dynamic or configurable hostname (besides localhost) #8

Merged pull requests:

  • Dynamically generate livereload script. #10 (rwjblue)

v1.2.3 (2014-10-06)

Full Changelog

Closed issues:

  • make injected script protocol relative #6

Merged pull requests:

v1.2.2 (2014-10-03)

Full Changelog

v1.2.1 (2014-10-03)

Full Changelog

Closed issues:

  • Insert livereload-script? #2

Merged pull requests:

v1.2.0 (2014-10-03)

Full Changelog

v1.1.0 (2014-09-22)

Full Changelog

v1.0.3 (2014-09-21)

Full Changelog

Merged pull requests:

v1.0.2 (2014-08-13)

Full Changelog

v1.0.1 (2014-08-12)

Full Changelog

v1.0.0 (2014-08-12)