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

Consider exposing :watch-fn compiler option? #491

Open
Ramblurr opened this issue Apr 30, 2018 · 1 comment
Open

Consider exposing :watch-fn compiler option? #491

Ramblurr opened this issue Apr 30, 2018 · 1 comment

Comments

@Ramblurr
Copy link

The cljs build api has a :watch-fn option that can be passed to execute a function after a successful build.

I've used this in the past to run some necessary project-specific side-effects.

Now that I'm trying to switch to lein and lein-cljsbuild, I tried to replicate this using the :notify-command option, but this doesn't work quite the same.

I specified :notify-command to be something like lein run -m clojure.main scripts/after-build.cljs. Then I booted cljs-build's auto and made a change to my file. If the change could be compiled properly, then it worked fine.

But if the change breaks compilation, then it goes into a compile loop attempting to compile over and over. Finally, when the build compiles again, it executes the notify-command once for every build attempt resulting in many invocations of the command.

Is there any chance lein-cljsbuils could add support for the :watch-fn compiler option?

@mneise
Copy link
Collaborator

mneise commented May 24, 2018

@Ramblurr Would you mind providing a sample repo to reproduce this problem?

Even when the build fails lein-cljsbuild should call the command provided with :notify-command.

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

2 participants