Skip to content

Instantly share code, notes, and snippets.

@sjha4
Forked from jlsherrill/two_tab_dev_server.md
Created July 9, 2018 22:51
Show Gist options
  • Save sjha4/3393bc1e02c590bc8a8adc6f0769ad6f to your computer and use it in GitHub Desktop.
Save sjha4/3393bc1e02c590bc8a8adc6f0769ad6f 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