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

Custom watcher #203

Closed
macluck opened this issue Feb 13, 2018 · 5 comments
Closed

Custom watcher #203

macluck opened this issue Feb 13, 2018 · 5 comments

Comments

@macluck
Copy link

macluck commented Feb 13, 2018

Hey,

I have a namespace translation.cljs which compiles translations from json files in public directory. I want to reload this namespace every time when json files are changed.
Here taoensso/tower#70 is a solution for figwheel. Would it be possible to implement something similar in shadow-cljs?

Cheers

@thheller
Copy link
Owner

Is this json file generated by hand or a tool?

If it is generated by running a tool you can just simply run

the-tool && touch src/path/to/your/translations.cljs

If you have some kind of make-ish setup that should be easy to integrate.

Watching the json file itself would be a bit more involved but certainly doable. Is the "easy" way an option?

@macluck
Copy link
Author

macluck commented Feb 13, 2018

json file is generated and modified by hand. The idea is too have a live reload feedback when updating translation files.
Basically yes, the solution would be touching the translations.cljs when json files are changed, but guess have to go here with a more involved solution :) Do you have any ideas?

@thheller
Copy link
Owner

How are you using shadow-cljs? Standalone or embedded?

@thheller
Copy link
Owner

You could use something like https://github.com/kimmobrunfeldt/chokidar-cli but I guess the goal is to have something running that starts with your build automatically.

shadow-cljs does not yet have a proper plugin API since I can't figure out how that should look and what plugins should be allowed to do.

@macluck
Copy link
Author

macluck commented Feb 23, 2018

Hey, chokidar actually is quite acceptable solution, as i can run it as npm script together with less preprocessor watch script.

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