Home > Article > Web Front-end > How to set remote mode for webpack-dev-server
This time I will show you how to set up remote mode for webpack-dev-server. What are the precautions for setting up remote mode for webpack-dev-server? What are the practical cases below? Let’s take a look. The webpack-dev-server configured in the package.json
file below is in development mode, which can be done using http://localhost:8080 or http://127.0.0.1:8080 Access"scripts": { "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", "build": "rimraf dist && cross-env NODE_ENV=production webpack --progress --hide-modules" },When remote access is required, modifications need to be made in package.json
"scripts": { "dev": "webpack-dev-server --host 10.30.1.102 --devtool eval --progress --colors --hot --content-base build", "build": "rimraf dist && cross-env NODE_ENV=production webpack --progress --hide-modules" },At this time, you can use http://192.168.10.8:8080 or http://127.0.0.1:8080 can be accessed in this form, but http://localhost:8080 cannot be accessed. I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website! Recommended reading:
How to call parent component in ES6 child component
plotly. How to use js drawing library
The above is the detailed content of How to set remote mode for webpack-dev-server. For more information, please follow other related articles on the PHP Chinese website!