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

Support import.meta.resolve #101

Open
pi0 opened this issue Dec 5, 2022 · 1 comment
Open

Support import.meta.resolve #101

pi0 opened this issue Dec 5, 2022 · 1 comment

Comments

@pi0
Copy link
Member

pi0 commented Dec 5, 2022

We shall polyfill it to allow upgrading from require.resolve

(function (exports, require, module, __filename, __dirname) { "use strict";console.log(import.meta.resolve('./a.ts'));
                                                                                              ^^^^

SyntaxError: Cannot use 'import.meta' outside a module
@kungpaogao
Copy link

I'm seeing a similar error but with import.meta.env, but saw this issue already existed - is this related, or is there another workaround for using import.meta.env? I'm able to get it to work if I use process.env, but then I use the scripts in a Vite/Astro project, so I would have to maintain both versions?

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

No branches or pull requests

2 participants