Closed leizongmin closed 1 year ago
This seems like another instance of the issue in #513, though this exposes it as a regression!
The problem was introduced from this commit https://github.com/nodejs/readable-stream/commit/b345071487c47b3c7b96007b26ea8bbe3ea97d15#diff-241fa22640048b6a147dec92f1ebf253043a1c4c342c7e52402112eb3c58f8fbR7
I have another question: why require
this module, but not use any properties or methods of stream
?
In order to avoid such regressions in the future can I suggest adding a test to this library which webpacks
import-all-test.js
import * as all from 'readable-stream'
using the config
webpack.config.js
const path = require("path");
module.exports = {
mode: "development",
entry: "./integration-tests/import-all-test.js",
output: {
path: path.resolve(__dirname, "integration-tests", "dist"),
filename: "import-all-test.js",
},
};
The test would just be running npm run test:build
where that script is defined as "test:build": "webpack"
Would you like to send a PR to fix this (adjust the build scripts) or just with the test?
https://github.com/nodejs/readable-stream/pull/517 should cover the main point - I will see if I can make that config more restrictive after the issue is patched.
This is an example file
test.js
:Run the following commands (esbuild@0.17.12):
It outputs:
If I use version
4.3.0
, it will output correctly.