Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Make node-sass --watch compile on startup #1742

Closed
fvgs opened this issue Oct 9, 2016 · 9 comments
Closed

Make node-sass --watch compile on startup #1742

fvgs opened this issue Oct 9, 2016 · 9 comments

Comments

@fvgs
Copy link

fvgs commented Oct 9, 2016

When node-sass is run with --watch, it does not compile until a change is detected. This is inconvenient in a couple of cases.

First, if a project has never been built, it is necessary to first run node-sass to compile, and then run node-sass --watch to commence watching. Second, if changes were made to files before the user ran node-sass --watch, those changes will not be reflected until another change is made. Similar to the first case, the user may need to run node-sass first to compile and then run node-sass --watch to commence watching.

The solution is to make node-sass --watch compile on startup. This is not a major inconvenience, but it would be a nice feature to have

@fvgs
Copy link
Author

fvgs commented Oct 9, 2016

I'll add that chaining the commands and using npm scripts pretty much makes this a non-issue from a usability perspective. But since there are no apparent drawbacks to compiling on startup, doing so seems like the more sensible default and the behavior most users would expect

@marvinhagemeister
Copy link
Contributor

This is a great idea! At work a few co-workers are always confused when they install a new project.

@xzyfer
Copy link
Contributor

xzyfer commented Oct 10, 2016

This has been discussed in the passed, most recently in #1660. There is no way to please everyone.

Will not be changing the current behaviour. The current behaviour a result of complaints about the behaviour you're suggesting. At the end of the day, you can easily achieve what you're asking for with two CLI commands, where as there would be no way achieve the current behaviour if compile happened on watch.

@xzyfer xzyfer closed this as completed Oct 10, 2016
@McPo
Copy link

McPo commented Nov 7, 2016

How about including a --build-on-start flag, If a PR was made would it be accepted?

I understand the reasoning behind not doing it, however having to duplicate commands can lead to issues. (You need to remember to update two commands each time a change is made).

Would there be an appetite for such a PR?

@xzyfer
Copy link
Contributor

xzyfer commented Nov 7, 2016

@McPo I appreciate your position but we are not open to such a PR at the time being. In my opinion adding extra flags is not the solution. Complicating the CLI moves the potential for bugs from a users script, to node-sass itself which can affect all users.

In v4 we may approach this differently by adding some kind of --build flag, which could be added with --watch to achieve the desired behaviour.

@sant123
Copy link

sant123 commented Mar 25, 2017

@xzyfer we are now in v4. Should this feature be considered? I mean, --build sounds great! 😄

@seansfkelley
Copy link

@xzyfer Your statements seem to be contradictory:

In my opinion adding extra flags is not the solution.

and

In v4 we may approach this differently by adding some kind of --build flag, which could be added with --watch to achieve the desired behaviour.

In any case, while I would also prefer compile-on-start, --build seems okay. I'm trying to reduce the number of little gotchas in my build system (of which there are already plenty) and this one took me by surprise as well.

@sant123
Copy link

sant123 commented Sep 17, 2017

Could be considered @xzyfer? A little --build option would be useful. Please, think about it!

@sant123
Copy link

sant123 commented Oct 17, 2017

Any advance of this issue? @xzyfer????

@sass sass locked and limited conversation to collaborators Oct 18, 2017
jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Fix sass#1742 - same expression on both sides of &&
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants