ember-cli-inject-live-reload icon indicating copy to clipboard operation
ember-cli-inject-live-reload copied to clipboard

Allow forcing localhost when not using Ember-CLI to serve project

Open davidgovea opened this issue 9 years ago • 3 comments

Related to issue #13 -

We don't use ember-cli to serve our dist/ directory. We also use a non-standard local hostname.

This change adds a liveReloadForceLocalhost option to force the addon to expect the livereload script on a fully-qualified localhost URL (rather than a relative path).

Ember-CLI's baseURL and port options are respected.

It could be further generalized to be more customizable, but my assumption is that CLI will really only be used on localhost. Since there's already a semi-hardcode (location.hostname || 'localhost'), this seems reasonable to me.

To use,

# file .ember-cli
{
  "liveReloadForceLocalhost": true
}

Seems to be working for us - let me know what you think! Thanks, -david

davidgovea avatar May 27 '15 00:05 davidgovea

I think this is fixed for you in the current version. https://github.com/rwjblue/ember-cli-inject-live-reload/blob/master/index.js#L19 . Now it automatically uses the current hostname.

ghost avatar Jun 05 '15 08:06 ghost

Hey @jrobeson - that's actually the problem in my case.

During development, our application is served from a non-standard host/IP through apache, and our environment does not allow for ember-cli to bind to that host.

I want to serve the application from some weird IP, but serve the livereload script from ember-cli on localhost.

The people in issue #13 seem do have similar needs.

davidgovea avatar Jun 05 '15 16:06 davidgovea

We have similar needs and were able to solve them with the changes in #25 and #36.

lukemelia avatar Oct 20 '16 17:10 lukemelia