Home >Web Front-end >JS Tutorial >Implement remote access configuration method in webpack-dev-server

Implement remote access configuration method in webpack-dev-server

亚连
亚连Original
2018-06-05 14:59:491879browse

Below I will share with you a webpack-dev-server remote access configuration method, which has a good reference value and I hope it will be helpful to everyone.

The webpack-dev-server configured in the package.json file below is in development mode and can be accessed using http://localhost:8080 or http://127.0.0.1:8080

"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" 
 },

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

How to use select assignment ng-options configuration method in angularjs?

How to use select to load data and select the default value in AngularJS?

Use vue-router to build the bottom navigation bar in vue-cli (detailed tutorial)

The above is the detailed content of Implement remote access configuration method in webpack-dev-server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn