From 3e9e4cbb6dd9d10d6cb4dfb5205eae3683587b75 Mon Sep 17 00:00:00 2001 From: Akshaj Verma Date: Sat, 2 Dec 2017 11:48:45 +0530 Subject: [PATCH 1/5] added openPage in webpack.config.babel.js --- webpack.config.babel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack.config.babel.js b/webpack.config.babel.js index d5b0186..0136882 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -4,7 +4,8 @@ import webpack from 'webpack'; const config = { devServer: { hot: true, - inline: true + inline: true, + openPage: '/localhost:8000' }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'), From 197565126350e983b2812c5e6cef3873ed4c96a6 Mon Sep 17 00:00:00 2001 From: Akshaj Verma Date: Sat, 2 Dec 2017 15:43:11 +0530 Subject: [PATCH 2/5] Automatically open browser when launching devServer --- webpack.config.babel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 0136882..2136cbe 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -5,7 +5,7 @@ const config = { devServer: { hot: true, inline: true, - openPage: '/localhost:8000' + openPage: 'https://localhost:8000' }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'), From e916e3cd10fc3489d1e9202805770f7887300f89 Mon Sep 17 00:00:00 2001 From: Akshaj Verma Date: Sun, 3 Dec 2017 10:27:32 +0530 Subject: [PATCH 3/5] output.publicPath uses /devServer --- webpack.config.babel.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 2136cbe..0e43091 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -1,11 +1,14 @@ -import path from 'path'; + import path from 'path'; import webpack from 'webpack'; const config = { devServer: { hot: true, inline: true, - openPage: 'https://localhost:8000' + proxy: { + '/': 'http://localhost:8000/' + } + }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'), @@ -56,7 +59,8 @@ const config = { }, output: { filename: 'bundle.js', - path: path.resolve(__dirname, 'build', 'client') + path: path.resolve(__dirname, 'build', 'client'), + publicPath: "localhost:8080/dev-server/bundle.js" }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(), From 74ab44eae48e1cfa8bcfd6d510f25605b0ce6b1f Mon Sep 17 00:00:00 2001 From: Akshaj Verma Date: Sun, 3 Dec 2017 10:31:19 +0530 Subject: [PATCH 4/5] output.publicPath uses /devServer --- webpack.config.babel.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 0e43091..6c71d7a 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -5,10 +5,7 @@ const config = { devServer: { hot: true, inline: true, - proxy: { - '/': 'http://localhost:8000/' - } - + }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'), From 28d15a3547a991af1b339d4e529e297c5f81ea0f Mon Sep 17 00:00:00 2001 From: Akshaj Verma Date: Sun, 3 Dec 2017 10:34:14 +0530 Subject: [PATCH 5/5] proxy index requests to localhost:8000 --- webpack.config.babel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 6c71d7a..0e43091 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -5,7 +5,10 @@ const config = { devServer: { hot: true, inline: true, - + proxy: { + '/': 'http://localhost:8000/' + } + }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'),