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

import.meta -> import_meta #48

Open
LomyCool opened this issue Apr 3, 2024 · 3 comments
Open

import.meta -> import_meta #48

LomyCool opened this issue Apr 3, 2024 · 3 comments

Comments

@LomyCool
Copy link

LomyCool commented Apr 3, 2024

image

With the vite-plugin-federation library, build the version and find that "import.meta" is converted to "import_meta"

配合使用 vite-plugin-federation 库,构建版本,发现 “import.meta” 被转换成 “ import_meta”

@LomyCool
Copy link
Author

LomyCool commented Apr 9, 2024

image
After source code debugging, it was found that it was caused by the buildRawTarget function
经过源码调试,发现是buildRawTarget函数导致的

@Menci
Copy link
Owner

Menci commented Jul 19, 2024

你原本项目的 Vite target 是什么?我的原理是首先以 esnext 编译然后转译,很可能是做了一些 transpile 变成这样的。这里 import_meta 看起来像是上面有一个 const import_meta = import_meta_available ? import.meta : some_polyfill 之类的东西?

@Menci
Copy link
Owner

Menci commented Jul 19, 2024

能提供一个复现吗

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

No branches or pull requests

2 participants