webpack icon indicating copy to clipboard operation
webpack copied to clipboard

configuration has an unknown property 'allowedHosts'

Open screendriver opened this issue 9 years ago • 3 comments

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)

screendriver avatar Jun 17 '17 14:06 screendriver

The version containing the new feature hasn't been published yet based on the change log.

@webpack-bot move to webpack/webpack-dev-server

bebraw avatar Jun 17 '17 18:06 bebraw

I've moved it to webpack/webpack-dev-server.

webpack-bot avatar Jun 17 '17 18:06 webpack-bot

staticOptions: { index: ‘main.html’ } 无效 image

xieanwen avatar Jul 20 '23 10:07 xieanwen