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

watch deep imports. #137

Closed
istrasoft opened this issue Nov 28, 2013 · 19 comments
Closed

watch deep imports. #137

istrasoft opened this issue Nov 28, 2013 · 19 comments

Comments

@istrasoft
Copy link

Some SASS files in my projects seem not to be watched and do not trigger a recompile...

Here is the folder tree:

/app.scss
/_myproject.scss
/myproject/_mycomponent.scss

In /app.scss I have :

@charset "UTF-8";
@import "myproject";

in /_myproject.scss I have :

@import
  "foundation",
  "myproject/mycomponent";

When I edit the contents of /myproject/_mycomponent.scss, the recompile is NOT triggered, even though if I manually hit the Compile button, everything is fine.

Actually, looking at the "imports" contents in the .koala/projects.js file in my home folder, it appears that all koala ever watches is the first-level imports, and does not recurse. Is that so ? Will this be extended to watch imports in imported files too please ?

@gogamoga
Copy link

Underscored filenames are ignored, at least its the case with coffee and js files, so might be same reason here

@istrasoft
Copy link
Author

That's not really logical according to spec. If you work on a project, you edit not only the main file but also partials, when they change, it makes sense that the main file gets reprocessed, doesn't it ?

@oklai
Copy link
Owner

oklai commented Dec 2, 2013

Yes, Koala now only watch the first-level imports, it's yet not perfect. I have plan to supports deep imports watched.

@smajl
Copy link

smajl commented Feb 24, 2014

EDIT: some of my problems were caused by variables in imports, my fault. But deep level imports are still needed. :)

Just struggling with same problem. Koala doesn't watch deep imports and I often work on quite huge and structured apps with many of them. Really looking forward to implementation of this feature. :)

@jacobischwartz
Copy link

I second the need for deep import watching!

@charlesroper
Copy link

Trying out Koala for first time today and immediately stumbled on this problem - looking forward to the next version!

Edit: here's an example:

http://cgit.drupalcode.org/adaptivetheme/tree/at_subtheme/sass

The _base.scss partial imports the _custom.scss file. Editing _base.scss is fine: it gets picked up and compiled by Koala, but the nested _custom.scss file does not get compiled when I edit it.

@davidtsong
Copy link

We still need this added. It's been almost a year.

@julkue
Copy link

julkue commented Nov 6, 2014

@oklai

@audricmas
Copy link

Is there a solution for watch deep imports ?

@julkue
Copy link

julkue commented Nov 28, 2014

@oklai When do you want to support this "bug"? It is essencial when developing big projects.

@oklai
Copy link
Owner

oklai commented Dec 1, 2014

This feature has been added in this commit ab45e45
Please wait for the next release.

@oklai oklai closed this as completed Dec 6, 2014
@julkue
Copy link

julkue commented Dec 6, 2014

Thanks. I will test it

@julkue
Copy link

julkue commented Dec 11, 2014

Can you please write us here when the fix is released? I've just tested it with the latest release and it doesn't seem to work.

@julkue
Copy link

julkue commented Jan 19, 2015

Seems still not working with deep includes and using include paths

@clemorphy
Copy link

I really need the autocompile feature to work when changes happen in @imported sass files.
Still not working with V 2.0.4 on Windows
Any date for this feature ?

Edit : actually it was not working because I was using the short syntax for imports :

@import home

But it works fine with the full file name :

@import home.sass

@clemorphy
Copy link

Well, on an other project, a change in an imported sass does not trigger the compilation, even with the full file name like mentioned above. I can't find what is wrong ...

@erythro
Copy link

erythro commented Feb 22, 2016

@oklai, @clemorphy is right, in sass the full file name is needed for the autocompile to work, so even though something like

@import base

is valid Sass for importing a file called "_base.sass", it's not being watched by Koala, and yet

@import "_base.sass"

works perfectly. If this isn't a bug, can it at least go into the docs as I straight up didn't realise Koala could autocompile imports and @clemorphy's solution has dramatically improved the usability of Koala for me!

@julkue
Copy link

julkue commented Feb 22, 2016

@clemorphy Dafuq, how old are you?

@itsmrwalsh
Copy link

itsmrwalsh commented Jun 17, 2019

If anyone is still struggling with this in 2019 - I can confirm that each partial will need its own line.
e.g.
@import "scss/file1.scss","scss/file2.scss";
^^ will not auto-compile on changes to those files

@import "scss/file1.scss";
@import "scss/file2.scss";

^^ This will auto-compile if you change either file.

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