- Operating System: debian stretch
- Node Version: 6.11.1
- NPM Version: 3.10.10
- webpack Version: 4.27.0
- webpack-dev-server Version: 3.1.10
Configuring devServer.public to a custom domain only updates the hot-reload socket GET calls, but not the hot-modules GET calls. It seems that there are no ways to configure the later.
And no output.hotUpdateMainFilename nor hotUpdateChunkFilename do allows absolute path.
Code
'use strict';
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
function resolve(dir) {
return path.join(__dirname, '..', dir);
}
const env = process.env.NODE_ENV === 'production' ? 'production' : 'development';
module.exports = {
mode: env,
target: 'web',
output: {
publicPath: '/',
path: path.resolve(__dirname, './build'),
filename: '[name].js',
hotUpdateMainFilename: '__hmr/[hash].hot-update.json',
hotUpdateChunkFilename: '__hmr/[id].[hash].hot-update.js'
},
devtool: env === 'production' ? false : 'eval-source-map',
resolve: {
extensions: ['.js', '.vue', '.json']
},
devServer: {
hot: true,
hotOnly: true,
inline: true,
host: '0.0.0.0',
public: 'hotreload.dev',
port: 80,
disableHostCheck: true,
quiet: true
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: 'img/[name].[hash:7].[ext]'
}
}
]
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
WEBPACK_ENV: JSON.stringify(env)
}),
new VueLoaderPlugin(),
// extract css into its own file
new MiniCssExtractPlugin({
filename: 'css/[name].[chunkhash].css',
chunkFilename: 'css/[id].[chunkhash].css'
})
]
};
Expected Behavior
Webapp should be served from http://localhost
Sockjs should be served from http://hotreload.dev/sockjs-node/info?t=1544113470603
Websocket should be served from ws://hotreload.dev/sockjs-node/571/zjz3ymti/websocket
HMR should be served from http://hotreload.dev/__hmr/e70392ebad328cc520e6.hot-update.json
Actual Behavior
Webapp is served from http://localhost
Sockjs is served from http://hotreload.dev/sockjs-node/info?t=1544113470603
Websocket is served from ws://hotreload.dev/sockjs-node/571/zjz3ymti/websocket
HMR is served from http://localhost/__hmr/e70392ebad328cc520e6.hot-update.json
For Bugs; How can we reproduce the behavior?
webpack-dev-server --config webpack.conf.js --hot --progress -d
Configuring
devServer.publicto a custom domain only updates the hot-reload socket GET calls, but not the hot-modules GET calls. It seems that there are no ways to configure the later.And no
output.hotUpdateMainFilenamenorhotUpdateChunkFilenamedo allows absolute path.Code
Expected Behavior
Webapp should be served from
http://localhostSockjs should be served from
http://hotreload.dev/sockjs-node/info?t=1544113470603Websocket should be served from
ws://hotreload.dev/sockjs-node/571/zjz3ymti/websocketHMR should be served from
http://hotreload.dev/__hmr/e70392ebad328cc520e6.hot-update.jsonActual Behavior
Webapp is served from
http://localhostSockjs is served from
http://hotreload.dev/sockjs-node/info?t=1544113470603Websocket is served from
ws://hotreload.dev/sockjs-node/571/zjz3ymti/websocketHMR is served from
http://localhost/__hmr/e70392ebad328cc520e6.hot-update.jsonFor Bugs; How can we reproduce the behavior?
webpack-dev-server --config webpack.conf.js --hot --progress -d