Y
Y
Yasuro2019-09-14 09:38:43
JavaScript
Yasuro, 2019-09-14 09:38:43

Why doesn't webPack server work after reboot?

Installed webPack used it for three days, then rebooted the computer, webpack does not work.
After yarn start, the following is displayed in the console:

webpack-dev-server
 ï½¢wdsï½£: Project is running at http://localhost:8000/
 ï½¢wdsï½£: webpack output is served from /
 ï½¢wdsï½£: Content not from webpack is served from ./dist

Localhost :8000 is loading endlessly.
If I turn off webPack, it still works and blocks port 8000, I have to kill it through taskkill.
webPack.config.js

const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');

module.exports = {
    mode: 'development',
    devtool: 'source-map',
    entry: path.join(__dirname, 'src', 'main', 'resources', 'static', 'js', 'main.js'),
    devServer: {
        contentBase: './dist',
        compress: true,
        port: 8000,
        allowedHosts: [
            'localhost:8080'
        ]
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
            },
            {
                test: /\.vue$/,
                loader: 'vue-loader'
            }
        ]
    },
    plugins: [
        new VueLoaderPlugin()
    ],
    resolve: {
        modules: [
            path.join(__dirname, 'src', 'main', 'resources', 'static', 'js'),
            path.join(__dirname, 'node_modules'),
        ],
    }
}


package.json

{
  "dependencies": {
    "vue": "^2.6.10",
    "vue-resource": "^1.5.1"
  },
  "devDependencies": {
    "@babel/core": "^7.6.0",
    "@babel/preset-env": "^7.6.0",
    "babel": "^6.23.0",
    "babel-loader": "^8.0.6",
    "vue-loader": "^15.7.1",
    "vue-template-compiler": "^2.6.10",
    "webpack": "^4.40.2",
    "webpack-cli": "^3.3.8",
    "webpack-dev-server": "^3.8.0",
    "wepack-cli": "^0.0.1-security"
  },
  "name": "ui",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "webpack-dev-server"
  }
}


In Google, everyone talks about the wrong config, but after all, everything worked for me before the reboot, so everything is correct. Yes, I tried a lot of tips, the result is the same.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question