You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging problems with unresolved import paths, it turned out that parsing import directives is triggered only when the directive actually starts the line:
JsFileRegexParser:347 (in version 20220601)
if (line.startsWith("import") || line.startsWith("export")) {
If you put whitespace before the import directive, it is just ignored.
Not sure if this is correct and/or intentional, in any case it is rather unexpected.
The text was updated successfully, but these errors were encountered:
* Pattern for matching import ... from './path/to/file'.
*
* <p>Unlike the goog.require() pattern above, this pattern does not allow multiple statements per
* line. The import/export <b>must</b> be at the beginning of the line to match.
*/
privatestaticfinalPatternES6_MODULE_PATTERN =
The comment seems to suggest (but doesn't outright state) that this is to keep only one statement per line, but then goes on to say that it must be at the start of the line. Perhaps leading whitespace could be acceptable, while still keeping one statement per line?
Not sure what are the exact consequences of ignoring the directive. Sometimes only the fact that the desired function (minification) actually works. Because processing the directive (in an environment when it cannot be resolved) is often something that user does not want or expect.
And AFAIK, processing static directives cannot be suppressed, can it? Only processing of the dynamic directives can be suppressed with --allow_dynamic_import, right?
When debugging problems with unresolved import paths, it turned out that parsing import directives is triggered only when the directive actually starts the line:
JsFileRegexParser:347 (in version 20220601)
If you put whitespace before the import directive, it is just ignored.
Not sure if this is correct and/or intentional, in any case it is rather unexpected.
The text was updated successfully, but these errors were encountered: