Odd output with webpack-dev-server
See original GitHub issueWhile I’m sure that building a .js entry point with webpack-dev-server is probably an odd use case (testing in an external .html that pulls in the built library), I figured I’d report the bug I came across anyway.
I have a code bundle that just has a single default export. When building normally with webpack
, I get the expected output:
export default LIB['default'];
But when building with webpack-dev-server
(no configuration changes), I get an unexpected output:
export default LIB;
export { LIB };
export default LIB;
export { LIB };
export default LIB['default'];
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10 (6 by maintainers)
Top Results From Across the Web
webpack output is served from undefined · Issue #2745 - GitHub
Describe the bug The output of webpack doesn't get served. What is the current behavior? My config: const path = require('path'); ...
Read more >Webpack devServer no output files generated? - Stack Overflow
Question - Answer: So it seems like the dist folder is generated elsewhere? [...] Yes. From one GitHub thread:.
Read more >Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >Introduction to webpack: Entry, Output, Loaders, and Plugins
At first, it might look strange to see a `.js` file require a stylesheet, ... npm install webpack webpack-dev-server --save-dev.
Read more >The webpack plugin I can't live without - rossta.net
It parses the "stats" output of a webpack build and constructs an interactive Voronoi treemap using the FoamTree library. It might look a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems to work fine for me, the dev server runs fine and the normal build continues to build correctly. I did have to correct your
skipModule
function though:Here you go: https://github.com/riovir/esm-webpack-plugin-i15-reprod
I’ve added some extra hoops, such as code splitting the bundled library to indicate it would still work if that pesky webpack-generated, extra HMR module wouldn’t topple the plugin over.
If the codebase is too bulky, don’t hesitate to ask for a simpler one!