Webpack adding duplicates of runtime into bundle
Asked Answered
M

1

0

Does anyone know why I am getting duplicates of the webpack runtimes in the bundle?

It's adding multiple numbers after the ? and the browser is seeing them as new files.

  • dev-server.js?
  • dev-server.js?52d4
  • dev-server.js?53d4*

webpack-dupes

See the file tree on the left: webpack-dupes2

Why is it doing this? I just want one copy of the file in the bundle.

Metalinguistics answered 25/5, 2016 at 21:22 Comment(6)
Do you have multiple entries in your configuration? Reading from the webpack-dev-server code it creates a server/client pair per each entry. That could be one explanation.Stile
Interesting. I do have 3 entry points in my webpack config, and I'm getting 3 duplicates. Let me check that and update.Metalinguistics
Yeah. That's what I would expect to see. Here's the code that does that.Stile
I'm guessing each of your entries points at jwt-decode. Hence those warnings.Stile
You are right! I combined my 3 entry points into 1 file, and made it 1 entry point, and no more duplication! If you make an answer I'll give you the credit. Now I just wonder why he wrote the code to put those duplicates, do you think we should make a pull request to modify that so it doesn't duplicate the codes?Metalinguistics
It was a bug fix by the looks of it so I'm thinking the lines are there for a purpose. I'll set up an answer based on all of this.Stile
B
0

Webpack sets up a client/server pair for each entry by design. That's why you are seeing all of those prints. Given each entry happens to depend on jwt-decode, you also get those warnings.

Here's the relevant code. The code was introduced as a part of a bug fix.

Basil answered 26/5, 2016 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.