Add -w Watch mode to lessc command line tool. Closes cloudhead/less.js#192 #194

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
@poswald

poswald commented Feb 8, 2011

As discussed in cloudhead/less.js#192

Call this with a command like:

$ lessc -w -x base.less base.css
8 Feb 17:26:10 - Change detected... Updated

One issue is that a parse error will cause the system to exit and you have to relaunch it. I also don't think it will watch imported stylesheets. Perhaps is there a better way to do this?

@wvl

This comment has been minimized.

Show comment
Hide comment
@wvl

wvl Mar 29, 2011

Looks good -- you also want to process the file when you first launch. I made that change here:
wvl/less.js@9a42c36

Also, I pushed a bunch of changes that avoid the process.exit, so you do not have to relaunch the script on errors. I'll add a separate pull request for that change.

wvl commented Mar 29, 2011

Looks good -- you also want to process the file when you first launch. I made that change here:
wvl/less.js@9a42c36

Also, I pushed a bunch of changes that avoid the process.exit, so you do not have to relaunch the script on errors. I'll add a separate pull request for that change.

@idris

This comment has been minimized.

Show comment
Hide comment
@idris

idris Jul 12, 2011

Contributor

Any idea when this will be merged in? Maybe we can get a 1.1.4 release with this functionality?

Contributor

idris commented Jul 12, 2011

Any idea when this will be merged in? Maybe we can get a 1.1.4 release with this functionality?

@idris

This comment has been minimized.

Show comment
Hide comment
@idris

idris Jul 13, 2011

Contributor

I've made a lesswatch command that can be used to watch entire directories, rather than just watching one file. It just automatically compiles .less files into their .css counterparts, so you don't have to specify output files.

Try it out and let me know what you think
https://gist.github.com/1080416

Contributor

idris commented Jul 13, 2011

I've made a lesswatch command that can be used to watch entire directories, rather than just watching one file. It just automatically compiles .less files into their .css counterparts, so you don't have to specify output files.

Try it out and let me know what you think
https://gist.github.com/1080416

@cloudhead

This comment has been minimized.

Show comment
Hide comment
@cloudhead

cloudhead Aug 22, 2011

Member

When developing, you can use watch-mode in the browser, by adding #!watch to the url, I don't want this as part of the command line tool.

Member

cloudhead commented Aug 22, 2011

When developing, you can use watch-mode in the browser, by adding #!watch to the url, I don't want this as part of the command line tool.

@cloudhead cloudhead closed this Aug 22, 2011

@ricardobeat

This comment has been minimized.

Show comment
Hide comment
@ricardobeat

ricardobeat Aug 28, 2011

Contributor

This is essential to the command-line tool, why wouldn't you want it? It's the most reliable way to use LESS in a development environment and have an exported CSS always ready for deploy.

Contributor

ricardobeat commented Aug 28, 2011

This is essential to the command-line tool, why wouldn't you want it? It's the most reliable way to use LESS in a development environment and have an exported CSS always ready for deploy.

@poswald

This comment has been minimized.

Show comment
Hide comment
@poswald

poswald Sep 2, 2011

I don't serve out the .less files directly to the browser so intentionally nerfing this feature of the command line tool seems a bit strange to me. I can understand wanting to keep a single way of doing things because it would be simpler but I don't think there would be a lot of confusion around this.

I added this as it was missing when I migrated from the original less project to the less.js project. Some of the styling work I do is with pages loaded into an embedded browser where I can't just append something to the url and we don't run javascript there anyway.

poswald commented Sep 2, 2011

I don't serve out the .less files directly to the browser so intentionally nerfing this feature of the command line tool seems a bit strange to me. I can understand wanting to keep a single way of doing things because it would be simpler but I don't think there would be a lot of confusion around this.

I added this as it was missing when I migrated from the original less project to the less.js project. Some of the styling work I do is with pages loaded into an embedded browser where I can't just append something to the url and we don't run javascript there anyway.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 15, 2011

Cloudhead, could you elaborate on why you don't want this in the command line tool? It seems like the perfect place for this kind of functionality.

ghost commented Nov 15, 2011

Cloudhead, could you elaborate on why you don't want this in the command line tool? It seems like the perfect place for this kind of functionality.

@sjl

This comment has been minimized.

Show comment
Hide comment
@sjl

sjl Dec 5, 2011

Contributor

I'd also like to know why? I use kicker to get around this on OS X but it makes working on Linux or Windows a pain in the ass.

Contributor

sjl commented Dec 5, 2011

I'd also like to know why? I use kicker to get around this on OS X but it makes working on Linux or Windows a pain in the ass.

@yvess

This comment has been minimized.

Show comment
Hide comment
@yvess

yvess Dec 28, 2011

The watch command is also very important to me. This makes the use cases of lessc a lot more broader.
Everbody who migrates from sass or the less.js ruby version can keep their workflow.

yvess commented Dec 28, 2011

The watch command is also very important to me. This makes the use cases of lessc a lot more broader.
Everbody who migrates from sass or the less.js ruby version can keep their workflow.

@cloudhead

This comment has been minimized.

Show comment
Hide comment
@cloudhead

cloudhead Dec 28, 2011

Member

There is a discussion on why here: cloudhead#246 (comment)

Member

cloudhead commented Dec 28, 2011

There is a discussion on why here: cloudhead#246 (comment)

@BruceClark

This comment has been minimized.

Show comment
Hide comment
@BruceClark

BruceClark May 9, 2012

As I mentioned in issue #192 — those still looking for a solution to this, I recommend Coyote http://github.com/imulus/coyote

Coyote is a tool allowing you to watch source files for Coffescript, SASS, or LESS and then compile them on the fly. Example: coyote -w input.less:output.css

As I mentioned in issue #192 — those still looking for a solution to this, I recommend Coyote http://github.com/imulus/coyote

Coyote is a tool allowing you to watch source files for Coffescript, SASS, or LESS and then compile them on the fly. Example: coyote -w input.less:output.css

@umrashrf

This comment has been minimized.

Show comment
Hide comment
@umrashrf

umrashrf Feb 6, 2014

Please add this life saver to command line!

umrashrf commented Feb 6, 2014

Please add this life saver to command line!

@Soviut

This comment has been minimized.

Show comment
Hide comment
@Soviut

Soviut Feb 6, 2014

@umrashrf As the other discussion says, there are already plenty of tools that do watching for multiple pre-compiled languages like LESS, CoffeeScript, Jade, etc. Look into Grunt or Gulp if you'd like to watch and build from the command line.

Soviut commented Feb 6, 2014

@umrashrf As the other discussion says, there are already plenty of tools that do watching for multiple pre-compiled languages like LESS, CoffeeScript, Jade, etc. Look into Grunt or Gulp if you'd like to watch and build from the command line.

@lukeapage

This comment has been minimized.

Show comment
Hide comment
@lukeapage

lukeapage Feb 9, 2014

Member

If anyone wants a new repo on less that is a watcher and then wants to help us refactor lessc to integrate with that watcher then they are more than welcome, but given grunt and gulp its not on my list of priorities.

Member

lukeapage commented Feb 9, 2014

If anyone wants a new repo on less that is a watcher and then wants to help us refactor lessc to integrate with that watcher then they are more than welcome, but given grunt and gulp its not on my list of priorities.

@Soviut

This comment has been minimized.

Show comment
Hide comment
@Soviut

Soviut Feb 9, 2014

Not only Grunt and Gulp, but the multitude of other GUI-based compilers with watchers as well. I think it's a duplication of effort and something others have done a better job solving already. Not to mention avoiding all the inevitable watcher-related issues that will clutter the issue tracker.

Soviut commented Feb 9, 2014

Not only Grunt and Gulp, but the multitude of other GUI-based compilers with watchers as well. I think it's a duplication of effort and something others have done a better job solving already. Not to mention avoiding all the inevitable watcher-related issues that will clutter the issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment