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

Atomizer plugin not working on a vite project #550

Closed
maheshbansod opened this issue Dec 2, 2022 · 7 comments
Closed

Atomizer plugin not working on a vite project #550

maheshbansod opened this issue Dec 2, 2022 · 7 comments

Comments

@maheshbansod
Copy link
Contributor

Describe the bug A clear and concise description of what the bug is.
I've followed the instructions here: https://acss.io/integrations/vite.html.
but the classes I add in my index.html file aren't getting generated.
The file atomizer.css is not generated.
I've created the repo https://github.com/maheshbansod/atomizer-vite which shows this.
I'm having the same problem on vite+ts project too.

To Reproduce Steps to reproduce the behavior:

  1. Follow instructions at https://acss.io/integrations/vite.html
  2. Add any atomizer class
  3. Check dist folder

Expected behavior A clear and concise description of what you expected to happen.
The file dist/atomizer.css should be generated with correct classes.

Additional context Add any other context about the problem here.

  • OS: [e.g. iOS8.1]
  • Package atomizer-plugins
  • Version ^1.2.0
@redonkulus
Copy link
Contributor

@maheshbansod thanks for the report. I found the same issues as you locally when testing and committed a fix to help.

Note that building atomizer still requires a manual step as vite does not automatically re-run atomizer on file changes. I'm not sure why that is, I will have to dig into the vite docs to see if that is something that can be enabled or something our plugin will have to do.

@maheshbansod
Copy link
Contributor Author

thanks for the response @redonkulus.
As for me, I couldn't find any config that could enable/disable this.
I wrote a Vite plugin inspired by unplugin atomizer in atomizer-plugins to enable re-running atomizer on change.
Not sure about the performance impact, I simply decided to write to the outfile on every transform. Debounce on that might help with the performance a bit.

@redonkulus
Copy link
Contributor

Interesting idea, can you send me the code, I can test it out and see about including it in the plugin library.

@maheshbansod
Copy link
Contributor Author

@redonkulus
Copy link
Contributor

@maheshbansod I tried your changes locally and they work well! Good job!. I've opened a PR to update the atomizer-plugin to incorporate these changes #553

@maheshbansod
Copy link
Contributor Author

awesome. thanks.

@maheshbansod
Copy link
Contributor Author

actually can we put it behind a dev flag?

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