Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support recursive imports #8

Open
indutny opened this issue Jul 4, 2017 · 3 comments
Open

Support recursive imports #8

indutny opened this issue Jul 4, 2017 · 3 comments

Comments

@indutny
Copy link
Owner

indutny commented Jul 4, 2017

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.

@indutny
Copy link
Owner Author

indutny commented Jul 8, 2017

It is supported as of webpack-common-shake@1.3.0.

@indutny indutny reopened this Jul 8, 2017
@indutny
Copy link
Owner Author

indutny commented Jul 8, 2017

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.

@indutny
Copy link
Owner Author

indutny commented Jul 8, 2017

Recognizing recursive pattern as in the issue description is harder, will keep this issue just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant