https://github.com/captbaritone/webpack-node-import-bug
Reproduce a Webpack bug
https://github.com/captbaritone/webpack-node-import-bug
Last synced: 9 months ago
JSON representation
Reproduce a Webpack bug
- Host: GitHub
- URL: https://github.com/captbaritone/webpack-node-import-bug
- Owner: captbaritone
- Created: 2019-04-25T23:04:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-25T23:06:14.000Z (over 6 years ago)
- Last Synced: 2025-01-10T23:32:17.536Z (about 1 year ago)
- Language: JavaScript
- Size: 49.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Extra Chunk Bug
This repo is a minimial reproduction of a bug I'm seeing where I end up with an extra, tiny, webpack chunk file.
It seems to happy any time I have a dynamic import wich has the `stream` NPM package somewhere in its dependnecy graph.
I can't reproduce this with any package other than stream. Stream itself is very small.
I'm guessing this has something to do with the fact that stream is shadowing node's stream.
I think it might be the case that Webpack is trying to use its own replacement for stream rather than the one in my node modules. If I uninstall the `stream` package, I see exactly the same behavior.
## To Repro
1. Clone to repo
2. `cd` into repo
3. `yarn`
4. `yarn build`
### Expected
Webpack makes my bundle, plus an additional chunk file containing the `stram` package.
### Actual
Webpack generates two "chunk" files: `dist/1.js` and `dist/2.js`.