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

does transform plugins can hot reload #15611

Open
1 task
gongzhxu opened this issue May 6, 2023 · 4 comments
Open
1 task

does transform plugins can hot reload #15611

gongzhxu opened this issue May 6, 2023 · 4 comments

Comments

@gongzhxu
Copy link

gongzhxu commented May 6, 2023

💻

  • Would you like to work on this feature?

What problem are you trying to solve?

i have an issue when i use babel transform plugin. like 'babel-plugin-content-transformer' , when i edit the configure file like *.toml the front web can't not be refresh with new content , event i restart the server it could not be take effect. i try to use other plugin have the same issue.

Describe the solution you'd like

Open an interface to make user choose

Describe alternatives you've considered

unfriendly i must convert the toml to json myself

Documentation, Adoption, Migration Strategy

No response

@babel-bot
Copy link
Collaborator

Hey @gongzhxu! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented May 7, 2023

babel-plugin-content-transformer can use api.addExternalDependency (https://dev.to/goatandsheep/how-to-use-babels-new-addexternaldependency-api-338h) to tell Babel that a file relies on some other external file. Babel will then pass this info to whoever is calling Babel (Webpack with babel-loader, @babel/cli, etc), which will be able to re-compile when that external dependency is called.

So this need to be supported both in the plugin and in whatever you are using to run Babel (babel-loader and @babel/cli already support this).

@gongzhxu
Copy link
Author

@nicolo-ribaudo thank a lot, the problem has been solved

@gongzhxu
Copy link
Author

When I use addExternalDependency watch file in Babel plugin, when I modify this file, sometimes it will trigger the reload of the whole project, but sometimes it is normal

@gongzhxu gongzhxu reopened this May 16, 2023
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

4 participants