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

feat(compiler-core): add current filename to TransformContext #8950

Merged
merged 2 commits into from Dec 8, 2023

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Aug 10, 2023

When using nodeTransform, I have found myself needing the absolute path in which the component is to do filesystem operations, which well cannot be done without that and I don't think a fork of the compiler is warranted for just that ;)

Since we already have this available to infer the component name, why not just pass it in the context to make it available to hooks?

This has no effect to the core and just allows plugins to use the current filename in hooks like nodeTransforms and directiveTransforms

When using `nodeTransform`, I have found myself needing the filename to do filesystem operations, which well cannot be done without the filename of the current component in the context passed to the function
@Tofandel Tofandel changed the title fix(compiler-sfc): add current filename to TransformContext fix(compiler-core): add current filename to TransformContext Aug 10, 2023
@Tofandel Tofandel changed the title fix(compiler-core): add current filename to TransformContext feat(compiler-core): add current filename to TransformContext Aug 10, 2023
@Tofandel Tofandel force-pushed the main-1 branch 2 times, most recently from 6ea9062 to 1c5f431 Compare August 10, 2023 09:52
@sxzz sxzz added the ready to merge The PR is ready to be merged. label Aug 13, 2023
@yyx990803 yyx990803 changed the base branch from main to minor December 5, 2023 14:54
@yyx990803 yyx990803 merged commit 638f1ab into vuejs:minor Dec 8, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged. version: minor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants