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

LOOSE mode includes ES6 modules that aren't imported by the entry point #2590

Closed
ghost opened this issue Jul 31, 2017 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Jul 31, 2017

I'm trying to convert our code from goog.provide modules to ES6 modules, but I've run into a difference in behavior that I didn't expect. When running in LOOSE dependency mode, the compiler includes all ES6 modules regardless of whether they're a dependency of the entry point. When I used goog.provide, these files were excluded from compilation. Based on https://github.com/google/closure-compiler/wiki/Managing-Dependencies#working-with-files-that-do-not-specify-dependencies, I'd expect the ES6 modules to work the way goog.provide modules do.

Running in STRICT mode eliminates files that aren't imported by the entry point, but it also eliminates non-module files (as expected). We have some non-module legacy files that we include in some of our builds, so I don't want to switch to STRICT if I can avoid it.

Can you make ES6 modules work like goog.provide, or at least clarify that section of the wiki?

Thanks!

@ChadKillingsworth
Copy link
Collaborator

Closed by #2641

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

No branches or pull requests

1 participant