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

Can I get or set global variables in Node.js when I am using SWC? #9534

Open
zhangmingyuan666 opened this issue Sep 5, 2024 Discussed in #9526 · 0 comments
Open

Can I get or set global variables in Node.js when I am using SWC? #9534

zhangmingyuan666 opened this issue Sep 5, 2024 Discussed in #9526 · 0 comments

Comments

@zhangmingyuan666
Copy link

Discussed in #9526

Originally posted by zhangmingyuan666 September 3, 2024
I am using rspack in Node.js, and use swc-loader as the loader of js files. I need to get or set some global variables in node.js to do something.

In babel plugin, I always use global like global.storeInfo to get global variables in node.js.

But in swc plugin, I have to write plugin in rust environment and then build it as wasm to work in Node.js environment. Can I get or set node.js global variables in swc plugin?

My Node version is 18.18.0, my swc plugin's swc_core version is 0.91.0

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

No branches or pull requests

1 participant