$ cat >webpack.config.js <<EOF
const BundleTracker = require("webpack-bundle-tracker");
module.exports = {
plugins: [new BundleTracker({ relativePath: true })],
};
EOF
$ touch src.js
$ npm i webpack webpack-bundle-tracker webpack-cli
…
+ webpack-cli@4.1.0
+ webpack@5.3.2
+ webpack-bundle-tracker@1.0.0-alpha.1
added 147 packages from 168 contributors and audited 147 packages in 5.273s
…
$ npx webpack
[webpack-cli] TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.relative (path.js:1054:5)
at /tmp/test/node_modules/webpack-bundle-tracker/lib/index.js:138:30
at /tmp/test/node_modules/lodash.foreach/index.js:221:11
at baseForOwn (/tmp/test/node_modules/lodash.foreach/index.js:153:20)
at /tmp/test/node_modules/lodash.foreach/index.js:190:14
at forEach (/tmp/test/node_modules/lodash.foreach/index.js:290:10)
at BundleTrackerPlugin._handleDone (/tmp/test/node_modules/webpack-bundle-tracker/lib/index.js:123:5)
at Hook.eval [as callAsync] (eval at create (/tmp/test/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/tmp/test/node_modules/tapable/lib/Hook.js:18:14) {
code: 'ERR_INVALID_ARG_TYPE'
}
At webpack-bundle-tracker/lib/index.js:138, the file object is a SizeOnlySource whose only property is _size, so fileInfo.path is undefined.
At
webpack-bundle-tracker/lib/index.js:138
, thefile
object is aSizeOnlySource
whose only property is_size
, sofileInfo.path
isundefined
.