Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch.js/browser-sync: use dev-ip instead of hard-coding localhost #1661

Closed
wants to merge 3 commits into from

Conversation

ptrckvzn
Copy link

@ptrckvzn ptrckvzn commented Jun 4, 2016

Hard-coding localhost prevented access to BrowserSync from other devices on the local network.

@retlehs
Copy link
Sponsor Member

retlehs commented Jun 6, 2016

http being hardcoded is also going to be an issue with sites that use SSL on local dev

@ptrckvzn
Copy link
Author

True. It does not work with Trellis SSL set to self-signed... Tried hard-coding https with "self-signed" for testing but it did not work either. It's strange because Safari does not mind if the publicPath is relative or left to default - assets are loaded. Chrome gives an ERR_INSECURE_RESPONSE in the console for every assets loaded.

@austinpray austinpray self-assigned this Jul 21, 2016
Patrick Vézina added 2 commits August 10, 2016 11:09
* sage-9: (32 commits)
  Update dependencies, incl Bootstrap 4 alpha 3
  Remove HTML comments from wrapper
  Fix path to stylesheet in add_editor_style
  Added contributing guidelines link to readme
  Create prototype of GitHub Issue Template using Trellis equivalent as a base
  Update required Node.js version
  Update comment for importing deps
  Boostrap
  Use shorthand syntax in main.js routes
  router doesn't require jQuery. use default params
  Fix display of theme name in Customizer
  Convert scripts to es6
  Refactor functions.php
  Rework template wrapper, bring back template_part()
  Fix tpyo
  Remove unused static variable in Wrapper
  Fix Obj->__toString() conditional logic in wrapper
  Allow Obj->__toString() in template heirarchy filter
  Wrap templates located outside the theme
  Remove path.extname() check
  ...

# Conflicts:
#	package.json
@ptrckvzn
Copy link
Author

The problem seems to be the css-loader with source maps enabled. If css in inlined (when running 'npm run watch'), It will not load css assets loaded with url(...) unless the public path is absolute (more info here).

The solution is to load all css assets with url-loader to inline them in the bundle or dynamically assign the public path. I'm trying the later here : ptrckvzn@d4256ae

This way, watch.js, assets/config.json are simplified and it works well with either http or https.

What do you think of this method?

@retlehs
Copy link
Sponsor Member

retlehs commented Aug 26, 2016

@ptrckvzn lgtm 👍

@ptrckvzn
Copy link
Author

I will close this and open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants