question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Common chunk much larger when served with webpack-dev-server

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? When the example below is built with webpack@v2.2.0-rc.3, without serving with webpack-dev-server the common chunk vendor is 1.59 kb. When served with webpack-dev-server@v2.2.0-rc.0 the same bundle is 245 kb. This is pretty confusing as it triggers performance budget warnings.

If the current behavior is a bug, please provide the steps to reproduce. Example: https://github.com/jouni-kantola/webpack-output-by-build-type/tree/webpack2-dev-server Pull the repo. Run following to see difference in file sizes:

  1. npm run build (vendor: 1.59 kb)
  2. npm run serve (vendor: 245 kb)

What is the expected behavior? It would be more intuitive if built files, with or without serving with webpack-dev-server, results in the same bundles.

Please mention your webpack and Operating System version.

  • webpack@v2.2.0-rc.3
  • webpack-dev-server@v2.2.0-rc.0
  • node v6.8.0
  • OS: MacOS Sierra (10.12.1)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SpaceK33zcommented, Jan 3, 2017

You can also include a <script> manually to include the client script webpack-dev-server needs. See this example.

1reaction
jouni-kantolacommented, Jan 1, 2017

Thank you. That fixed the issue. I didn’t even know that option existed.

Is there anyway of controlling where the emitted code for inline should be outputted? I’ve extracted the webpack manifest and inlined that into the page. This seems like a good place to include what’s required for webpack-dev-server as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Splitting - webpack
This is by far the easiest and most intuitive way to split code. ... to extract common dependencies into an existing entry chunk...
Read more >
An in-depth guide to performance optimization with webpack
app and profile.js are much smaller now. · The names of the vendor bundles indicate from which application chunk the dependencies were pulled....
Read more >
Webpack-dev-server HMR not working with multiple entry points
It seems like HMR has stopped working in my browser. Webpack is running and bundling it correctly! Any ideas? Thanks so far and...
Read more >
Sort-of-beginner's guide to webpack-dev-server - ITNEXT
comparison of node server to webpack-dev-server ... Common chunks plugin: Optimizes bundle sizes if we're using any particular module in ...
Read more >
A mostly complete guide to webpack 5 (2020)
Common JS modules; AMD modules; CSS import; Images url; ES modules. That is, webpack is able to ingest dependencies from any of these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found