Replies: 2 comments 4 replies
-
swc/crates/swc_common/src/plugin/metadata.rs Lines 55 to 57 in 6124573 Filename supposed to include paths if possible. In my opinion if that doesn't work for some cases it needs to be correctly extended instead of trying to add new context. |
Beta Was this translation helpful? Give feedback.
4 replies
-
you can fork my repository, I used get_context to get the file path in my code. https://github.com/coder-xiaotian/swc-useclient/ It should be noted that you need to set lto=false in Cargo.toml. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature
Currently there're only 3 items provided in plugin context:
I'd propose to add a new context information: file path. This can be relative path or absolute path. I'm creating a plugin that will inject some debug info which requires file path, but SWC can't provide this to plugin now.
Babel plugin or link to the feature description
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions