babel-preset-vite version: 1.0.4
babel-plugin-transform-vite-meta-env version: 1.0.3
babel-plugin-transform-vite-meta-glob version: 1.0.3
@babel/core version: 7.11.1
node version: 16.17.1
npm (or yarn) version: yarn 1.22.19
Relevant code or config:
// working 👍
Object.values(import.meta.glob("src/images/*.jpg"))
// not working 👎
Object.values(import.meta.glob("src/images/*.jpg", { eager: true, as: "url" }) // or any options parameter value
What you did:
What happened:
This error occurs when attempting to run tests
SyntaxError: Cannot use 'import.meta' outside a module
Reproduction:
TBD (I've got a big application and I'm not in a place to strip it down to the essentials right now)
Problem description:
It looks like import.meta.glob doesn't get transformed when a second argument it passed.
Suggested solution:
I'm not familiar enough with babel plugins, but if we can specify optional arguments when doing the transformation I'm guessing that will solve it. Not sure how involved we want to make the transformation though. It might be a lot to replicate what Vite does with import.meta.glob with options.
babel-preset-viteversion: 1.0.4babel-plugin-transform-vite-meta-envversion: 1.0.3babel-plugin-transform-vite-meta-globversion: 1.0.3@babel/coreversion: 7.11.1nodeversion: 16.17.1npm(oryarn) version: yarn 1.22.19Relevant code or config:
What you did:
What happened:
This error occurs when attempting to run tests
Reproduction:
TBD (I've got a big application and I'm not in a place to strip it down to the essentials right now)
Problem description:
It looks like
import.meta.globdoesn't get transformed when a second argument it passed.Suggested solution:
I'm not familiar enough with babel plugins, but if we can specify optional arguments when doing the transformation I'm guessing that will solve it. Not sure how involved we want to make the transformation though. It might be a lot to replicate what Vite does with
import.meta.globwith options.