closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

import/export directives ignored when not at the start of line

Open msevcenko opened this issue 9 months ago • 2 comments

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.

msevcenko avatar Sep 13 '23 19:09 msevcenko