Skip to content

Instantly share code, notes, and snippets.

@jlsherrill
Last active August 30, 2018 16:36
Show Gist options
  • Save jlsherrill/f7d93a2fc5d3c90adf9ba3f75e2aef8d to your computer and use it in GitHub Desktop.
Save jlsherrill/f7d93a2fc5d3c90adf9ba3f75e2aef8d to your computer and use it in GitHub Desktop.

in config/settings.yaml :webpack_dev_server: true

In one tab:

rails s -b '0.0.0.0'

In a 2nd tab:

BIND=0.0.0.0 ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js --https $WEBPACK_OPTS

In your browser:

https://hostname

You may need to disable host checks:

diff --git a/config/webpack.config.js b/config/webpack.config.js
index b45e292..61af2c4 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -182,6 +182,7 @@ module.exports = env => {
     }
 
     config.devServer = {
+      disableHostCheck:true,
       host: process.env.BIND || 'localhost',
       port: devServerPort,
       headers: { 'Access-Control-Allow-Origin': '*' },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment