-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I have a very simple setup of the webpack-dev-server running on port 8080 behind an nginx proxy listening on port 80 and routing traffic to the upstream server. However, I'm getting lots of console log errors when the server tries to access the sock.js instance:
http://wepackserver.localhost:8080/sockjs-node/info?t=1514563803767
Is is possible to configure the setup of sock.js to go straight to:
http://wepackserver.localhost/sockjs-node/info?t=1514563803767
I've looked at the documentation and tried using the proxy option, but nothing seems to work.
Here is my config, created by the vue-cli package using the webpack-simple template:
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/app.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true,
port: 8080,
host: '0.0.0.0',
disableHostCheck: true
},
performance: {
hints: false
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}
Metadata
Metadata
Assignees
Labels
No labels