每次我使用webpack-dev-server --config ./webpack.config.js --mode开发启动Webpack网站
网站在端口8080 BUT上启动 它还在端口4000上启动“某物”。(我不知道这是什么,我可以与之交互。它仅使用该端口。我在项目中没有使用4000进行任何配置。) 我需要4000端口来做另一件事。
1)端口4000上有什么? 2)如何使用其他端口?
文件:
const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = {
entry: {
web: './src/index.js',
html: "./src/index.html",
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
"presets": ["@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
[
"@babel/transform-runtime" //needed for the server
],
[
"@babel/plugin-proposal-class-properties" //needed to have propertie function in js class
]
]
}
},
},
{
test: /\.html$/,
exclude: /node_modules/,
use: [
{
loader: "html-loader"
}
]
}, { test: /\.css$/, loader: "style-loader!css-loader" }]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html",
chunks: ['web'],
})
]
};