webpack-dev-server/client added twice

Created on 5 Dec 2016  路  2Comments  路  Source: webpack/webpack-dev-server

Hi!

My webpack.config.js

const path = require('path');

module.exports = {
  entry: [
    'webpack-dev-server/client?https://my.address.com/',
    'webpack/hot/only-dev-server',
    './index.js',
  ],
  output: {
    filename: "build.js",
    path: path.join(__dirname, 'static'),
  },
  devServer: {
    contentBase: path.join(__dirname, 'static'),
    proxy: {
      '**': {
        target: 'https://my.addres.com/t/',
        secure: false
      }
    }
  }
}

I work with reversed ssh tunnel like

ssh -v -N -R :9010:localhost:8080 my.address.com

and standard command to run webpack-dev-server npm run: webpack-dev-server

The problem is that I have two initialised WS connections.

First invalid because in my build.js file I found

/* WEBPACK VAR INJECTION */}.call(exports, "?http://localhost:8080"))

and second (correct), pointing to https://my.address.com/.

WS connection should established only once for address I provided.

Webpack: 2.1.0-beta.27
Webpack dev server: 2.1.0-beta.12

Most helpful comment

When you're using the CLI, it will automatically add "webpack-dev-server/client" for you.

You can do two things:

  • Remove the client from your entry, and run the CLI with webpack-dev-server --public=my.address.com
  • Add --no-inline to your CLI.

All 2 comments

When you're using the CLI, it will automatically add "webpack-dev-server/client" for you.

You can do two things:

  • Remove the client from your entry, and run the CLI with webpack-dev-server --public=my.address.com
  • Add --no-inline to your CLI.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrdulin picture mrdulin  路  3Comments

nikirossi picture nikirossi  路  3Comments

Jack-Works picture Jack-Works  路  3Comments

Ky6uk picture Ky6uk  路  3Comments

hnqlvs picture hnqlvs  路  3Comments