Skip to content

configuration has an unknown property 'allowedHosts' #5080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
screendriver opened this issue Jun 17, 2017 · 3 comments
Closed

configuration has an unknown property 'allowedHosts' #5080

screendriver opened this issue Jun 17, 2017 · 3 comments

Comments

@screendriver
Copy link

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)

@bebraw
Copy link
Contributor

bebraw commented Jun 17, 2017

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

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

@webpack-bot
Copy link
Contributor

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

@xieanwen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants