Skip to content

Glob imports don't parse #137

Description

@dzearing

When parsing this import:

import(`@scope/package/intl/${getLocaleName(
      locale
    )}/strings.js`);

...it returns { n: undefined }.

Expected:

Returns { n: '@scope/packages/intl/${...}/strings.js' }

I recognize the content within the variable could be anything which would make the string a lot less useful to parse. I think it would be ok to strip content in the template string injected variable, so long as the glob were identifiable. For example, something like an asterisk replacement would work too:

{ n: '@scope/packages/intl/*/strings.js' }

This would allow the glob match to be handled dynamically.

Workaround:

The s and e args are intact, so we can slice this out in js and try to simplify to work around, but maybe it would be more efficient in the lower layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions