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

have to clean before changing build config #426

Open
ioRekz opened this issue Nov 3, 2015 · 10 comments
Open

have to clean before changing build config #426

ioRekz opened this issue Nov 3, 2015 · 10 comments
Milestone

Comments

@ioRekz
Copy link

ioRekz commented Nov 3, 2015

When I'm done developing a feature and want to build the production js, I often forget to clean my outputs files so a "lein cljsbuild once min" for example would say "compiling" without actually building my app.js

Is there a way to force the build when I change the build config ? lein clean is not that hard but I would prefere not having to.

@mneise
Copy link
Collaborator

mneise commented Nov 3, 2015

It should rebuild your project once you made changes to your code. Do you have a link to your project or could you attach your project.clj file?

@ioRekz
Copy link
Author

ioRekz commented Nov 3, 2015

Yes. But quite often i'm developing with lein figwheel. When everything is ok I start the prod build but my file has not changed so it build nothing. That's why I need to clean

@mneise
Copy link
Collaborator

mneise commented Nov 4, 2015

Sorry, I can't reproduce your problem. I assume you are using different output-dirs in your config? It would be really helpful if you could post your config.

@magomimmo
Copy link
Contributor

The lein cljsbuild clean subtask has been removed starting from lein-cljsbuild 1.0.4. So, even if you hook cljsbuild into the main leiningen tasks, when you call lein clean task, it only cleans the default lein :clean-targets.

https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L305 https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L305

HIH

On Nov 4, 2015, at 10:54 AM, Maria Geller (Neise) [email protected] wrote:

Sorry, I can't reproduce your problem. I assume you are using different output-dirs in your config? It would be really helpful if you could post your config.


Reply to this email directly or view it on GitHub #426 (comment).

@magomimmo
Copy link
Contributor

sorry this is the right line number

https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L303 https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L303

On Nov 4, 2015, at 11:00 AM, Mimmo Cosenza [email protected] wrote:

The lein cljsbuild clean subtask has been removed starting from lein-cljsbuild 1.0.4. So, even if you hook cljsbuild into the main leiningen tasks, when you call lein clean task, it only cleans the default lein :clean-targets.

https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L305 https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L305

HIH

On Nov 4, 2015, at 10:54 AM, Maria Geller (Neise) <[email protected] mailto:[email protected]> wrote:

Sorry, I can't reproduce your problem. I assume you are using different output-dirs in your config? It would be really helpful if you could post your config.


Reply to this email directly or view it on GitHub #426 (comment).

@ioRekz
Copy link
Author

ioRekz commented Nov 4, 2015

Here is my file. https://gist.github.com/ioRekz/17ff586577cd930e69cb

Again, the problem is not the cleaning (which is actually working) but the fact that I have to clean or change a file to force a rebuild when I change the build config (from dev to min).

So I do a lein cljsbuild once dev.
Then lein cljsbuild once min will do nothing since nothing changed.

Because of that, I usually forgot to clean and upload my dev assets to my servers

@mneise
Copy link
Collaborator

mneise commented Nov 4, 2015

What you could do is to have different output-dirs for your two different builds, for example:

:cljsbuild {:builds [{:id "dev"
                      :figwheel true
                      :source-paths ["src"]
                      :compiler {:main foo.core
                                 :asset-path "js/out"
                                 :output-to "resources/public/js/out/foo.js"
                                 :output-dir "resources/public/js/out"
                                 :verbose true}}
                     {:id "min"
                      :source-paths ["src"]
                      :compiler {:main foo.core
                                 :asset-path "js/release"
                                 :output-to "resources/public/js/release/foo.js"
                                 :output-dir "resources/public/js/release"
                                 :optimizations :advanced}}]}

@ioRekz
Copy link
Author

ioRekz commented Nov 5, 2015

Indeed, but then I need 2 different index.html right ?

On Wed, Nov 4, 2015 at 9:07 PM, Maria Geller (Neise) <
[email protected]> wrote:

What you could do is to have different output-dirs for your two different
builds, for example:

:cljsbuild {:builds [{:id "dev"
:figwheel true
:source-paths ["src"]
:compiler {:main foo.core
:asset-path "js/out"
:output-to "resources/public/js/out/foo.js"
:output-dir "resources/public/js/out"
:verbose true}}
{:id "min"
:source-paths ["src"]
:compiler {:main foo.core
:asset-path "js/release"
:output-to "resources/public/js/release/foo.js"
:output-dir "resources/public/js/release"
:optimizations :advanced}}]}


Reply to this email directly or view it on GitHub
#426 (comment)
.

@mneise
Copy link
Collaborator

mneise commented Nov 5, 2015

Yes.

@mneise
Copy link
Collaborator

mneise commented Dec 4, 2015

This issue is the same as #414. Will look into fixing this with 2.0.

@mneise mneise added this to the 2.0.0 milestone Dec 4, 2015
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

3 participants