aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/webpack.config.js
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-11-16 03:34:17 +0800
committerGitHub <noreply@github.com>2018-11-16 03:34:17 +0800
commit34d86647bfc56dbf8221b08b3d7bdeba08f46ca1 (patch)
treece2b47879469c3aeb2af11360df6a6f7dbc3f341 /packages/instant/webpack.config.js
parent1dd903ddcc99279d2cfe92e01ef77c901b07246f (diff)
parent633d17ffdeed4cd950f9d55f58b572f96390a63a (diff)
downloaddexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar.gz
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar.bz2
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar.lz
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar.xz
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.tar.zst
dexon-sol-tools-34d86647bfc56dbf8221b08b3d7bdeba08f46ca1.zip
Merge pull request #1265 from 0xProject/feature/instant/expose-webpack-dev-server
[instant ] Expose webpack-dev-server content to local network
Diffstat (limited to 'packages/instant/webpack.config.js')
-rw-r--r--packages/instant/webpack.config.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js
index 78a33ce90..3129e13a6 100644
--- a/packages/instant/webpack.config.js
+++ b/packages/instant/webpack.config.js
@@ -1,7 +1,8 @@
const path = require('path');
+const ip = require('ip');
// The common js bundle (not this one) is built using tsc.
// The umd bundle (this one) has a different entrypoint.
-module.exports = {
+const config = {
entry: './src/index.umd.ts',
output: {
filename: '[name].bundle.js',
@@ -24,5 +25,15 @@ module.exports = {
devServer: {
contentBase: path.join(__dirname, 'public'),
port: 5000,
+ host: '0.0.0.0',
+ after: () => {
+ if (config.devServer.host === '0.0.0.0') {
+ console.log(
+ `webpack-dev-server can be accessed externally at: http://${ip.address()}:${config.devServer.port}`,
+ );
+ }
+ },
},
};
+
+module.exports = config;