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

Glob imports don't parse #137

Open
dzearing opened this issue Oct 12, 2022 · 1 comment
Open

Glob imports don't parse #137

dzearing opened this issue Oct 12, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dzearing
Copy link
Contributor

dzearing commented Oct 12, 2022

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.

@guybedford
Copy link
Owner

It would be great to support a feature like this definitely!

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

No branches or pull requests

2 participants