configuration has an unknown property 'allowedHosts'
Do you want to request a feature or report a bug?
Bug 🐛
What is the current behavior?
I added devServer.allowedHosts to my webpack.config.js and it complains with
configuration has an unknown property 'allowedHosts'. These properties are valid:
object { hot?, hotOnly?, lazy?, host?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, clientLogLevel?, overlay?, key?, cert?, ca?, pfx?, pfxPassphrase?, inline?, disableHostCheck?, public?, https?, contentBase?, watchContentBase?, open?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, noInfo?, quiet?, serverSideRender?, index?, log?, warn? }
If the current behavior is a bug, please provide the steps to reproduce.
Just add
devServer: {
allowedHosts: [
'.host.com',
'host2.com'
]
},
to your webpack.config.js
What is the expected behavior?
It should not complain about it because the property is documented here
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
webpack 2.6.1
I just want to access the webpack-dev-server outside of my local dev machine (e.g. my mobile phone)
The version containing the new feature hasn't been published yet based on the change log.
@webpack-bot move to webpack/webpack-dev-server
I've moved it to webpack/webpack-dev-server.
staticOptions: {
index: ‘main.html’
}
无效