Мой файл конфигурации webpack для режима разработки , когда я запускаю сервер узлов в режиме разработки, несколько запросов (например: http://localhost: 8090 / sock js -node / 563 / 14x42n5e / xhr_streaming? t = 1578560165901 ) попадает на сервер, это происходит в режиме dev, а не в сборке prod
Я предполагаю, что это происходит из-за опции горячей перезагрузки
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const { ReactLoadablePlugin } = require('react-loadable/webpack');
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin');
const DashboardPlugin = require('webpack-dashboard/plugin');
const { getAppEnv } = require('./env');
const env = getAppEnv();
const { PUBLIC_URL = '' } = env.raw;
const resolvePath = relativePath => path.resolve(__dirname, relativePath);
module.exports = {
mode: 'development',
devtool: 'cheap-module-source-map',
entry: [
'webpack-hot-middleware/client?path=/__webpack_hmr&reload=true',
resolvePath('../src/index.js')
],
output: {
path: resolvePath('../build'),
filename: '[name].bundle.js',
chunkFilename: '[name].chunk.js',
publicPath: PUBLIC_URL + '/'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter
},
loader: 'eslint-loader'
}
],
include: resolvePath('../src')
},
{
test: /\.(js|jsx)$/,
include: resolvePath('../src'),
loader: 'babel-loader',
options: {
cacheDirectory: true
}
},
{
test: /\.(eot|otf|ttf|woff|woff2)$/,
use: 'file-loader'
},
{
test: /\.svg$/,
use: [
{
loader: 'svg-url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024,
noquotes: true
}
}
]
},
{
test: /\.(jpg|png|gif)$/,
use: [
{
loader: 'url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024
}
},
{
loader: 'image-webpack-loader',
options: {
mozjpeg: {
enabled: false
// NOTE: mozjpeg is disabled as it causes errors in some Linux environments
// Try enabling it in your environment by switching the config to:
// enabled: true,
// progressive: true,
},
gifsicle: {
interlaced: false
},
optipng: {
optimizationLevel: 7
},
pngquant: {
quality: '65-90',
speed: 4
}
}
}
]
},
{
test: /\.s?css$/,
exclude: [resolvePath('../src/styles')],
use: [
'style-loader',
{
loader: 'css-loader',
options: {
// camelCase: true,
// modules: true
}
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
// browsers: ['last 2 versions', 'not ie < 11'],
flexbox: 'no-2009'
})
]
}
},
'sass-loader',
'import-glob-loader'
]
},
{
test: /\.s?css$/,
include: [resolvePath('../src/styles')],
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
// browsers: ['last 2 versions', 'not ie < 11'],
flexbox: 'no-2009'
})
]
}
},
'sass-loader',
'import-glob-loader'
]
}
]
},
plugins: [
new webpack.DefinePlugin(env.forWebpackDefinePlugin),
new webpack.HotModuleReplacementPlugin(),
new CaseSensitivePathsPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new LodashModuleReplacementPlugin(),
new ErrorOverlayPlugin(),
new DashboardPlugin(),
new ReactLoadablePlugin({
filename: 'build/react-loadable.json'
})
],
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty'
}
};
скриншоты ... ![enter image description here](https://i.stack.imgur.com/aw2Oh.png)
![enter image description here](https://i.stack.imgur.com/xZD9y.png)