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

bug: dev theme hot update unocss.config.ts invalid #48

Closed
hairyf opened this issue Jul 13, 2022 · 8 comments
Closed

bug: dev theme hot update unocss.config.ts invalid #48

hairyf opened this issue Jul 13, 2022 · 8 comments

Comments

@hairyf
Copy link
Contributor

hairyf commented Jul 13, 2022

image

@YunYouJun
Copy link
Owner

https://github.com/unocss/unocss/blob/9fd1583aff3be2ff04a775458cf023e080f23c5c/packages/vite/src/config-hmr.ts#L24

Since I can't get the ctx of unocss, I haven't figured out a good way to hot reload it at the moment.

@hairyf
Copy link
Contributor Author

hairyf commented Jul 13, 2022

Does this mean that you can't get HMR without using configFile , looks like it should be an issue with unocss

@hairyf
Copy link
Contributor Author

hairyf commented Jul 13, 2022

Is there a way we can trigger change, and pass if (!sources.includes(p))

seems unlikely,closing configFile results in an empty source

@hairyf hairyf changed the title feat: dev theme hot update unocss.config.ts invalid bugs: dev theme hot update unocss.config.ts invalid Jul 14, 2022
@hairyf hairyf changed the title bugs: dev theme hot update unocss.config.ts invalid bug: dev theme hot update unocss.config.ts invalid Jul 14, 2022
@YunYouJun
Copy link
Owner

YunYouJun commented Jul 14, 2022

I don't have a good way to trigger hot updates unless I can get the internal reloadConfig method.

Or tell unocss which files need to be watched.

I will create a issue for unocss.

@YunYouJun
Copy link
Owner

Oops, After reading the source code, I found that it also supports a configDeps configuration, which I will see if I can implement with it.

@YunYouJun
Copy link
Owner

Oops, After reading the source code, I found that it also supports a configDeps configuration, which I will see if I can implement with it.

Not work. I can not re-pass my config to init UnoCSS plugins.

@YunYouJun
Copy link
Owner

unocss/unocss#1262

@YunYouJun
Copy link
Owner

Unfortunately, we have not received feedback from unocss so far, and corresponding functions cannot be realized from valaxy's perspective.

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

No branches or pull requests

2 participants