I've got my simple login website fully coded and functional on the webpack dev server. how can i display it with my external IP? I've already port forwarded my router on port 9000 but when i tried www.myIp:portnumber its not working. Below is my webpack config for the webpack dev server.
//Webpack config
module.exports = {
entry: './app/main.js',
output: {
path: './app',
filename: 'bundle.js'
},
devServer: {
inline: true,
contentBase: './app',
port: 9000
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}
]
}
}
Answer : D) 8080 is the default where webpack-dev-server runs.
webpack-dev-server can proxy some requests to others servers. This might be useful for developing API client when you want to send requests to same domain. Proxy is configured via proxy parameter.
devServer.client Allows to set log level in the browser, e.g. before reloading, before an error or when Hot Module Replacement is enabled. webpack.config.js module.
Set the host property:
devServer: {
inline: true,
contentBase: './app',
port: 9000,
host: '0.0.0.0'
}
https://webpack.js.org/configuration/dev-server/#devserver-host-cli-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With