webpack-common-shake
webpack-common-shake copied to clipboard
Support recursive imports
Instead of bailing out on code like this:
// root.js
require('./lib').a.b
// lib.js
exports.a = require('./a');
// a.js
exports.b = 1;
We should recognize recursive pattern and store uses in a.js
.
It is supported as of [email protected]
.
Oh, actually the thing that it supported is more limited:
// a
exports.a = require('./b').b;
// b
exports.b = 1;
If exports.a
is unused - exports.b
will be removed too.
Recognizing recursive pattern as in the issue description is harder, will keep this issue just in case.