google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.35k stars 1.14k forks source link

Whitespace only mode breaks ES6 modules #1779

Open supersteves opened 8 years ago

supersteves commented 8 years ago

This is a bit like https://github.com/google/closure-compiler/issues/611

It is concatenating the modules without any module scoping/loading system, and leaving the import / export statements as-is.

This means you can't debug whitespace only mode in Chrome and must wait for a longer compilation.

Dominator008 commented 8 years ago

I'd say this is a current limitation in Chrome. IMO WHITESPACE_ONLY should keep the import / export statements as is. We can revisit this once we have a better story of how module loading works.

rictic commented 6 years ago

It seems like the two-argument goog.loadModule solution outlined by @jplaisted in https://github.com/google/closure-compiler/issues/2647 would fix this.