Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Compiling one main file in project #8

Closed
PatrickPahlke opened this issue Aug 15, 2017 · 10 comments
Closed

Compiling one main file in project #8

PatrickPahlke opened this issue Aug 15, 2017 · 10 comments
Assignees

Comments

@PatrickPahlke
Copy link

Is it possible to specify one "main"-file, so the compiler ignores all other scss files in the project? Here it is necessary to watch for changes in all files that are importet in the main file (or maby simply watch for all files but compile only the specified main file).

That would be very useful, Thanks.

@ritwickdey
Copy link
Owner

okay, I'll add a separate include list settings :)

Thanks a lot for the suggestion :)

@ritwickdey
Copy link
Owner

The feature is added with v0.4.0. Please update the extension. Let me know if you like it or not :)

@PatrickPahlke
Copy link
Author

Thank's for adding this feature. Very nice 👍
But there is one thing. If i use @import "somestuff.scss";, so the compiler is not watching for the changes in the imported files.
Could you do something that the imported files will also being watched for changes an each time the "main file" will be compiled including all imported files? Sorry for my bad english 😉 I hate all languages expecting for programming languages.

Thank you very much!

@ritwickdey
Copy link
Owner

ritwickdey commented Aug 24, 2017

Hi, I understand. but I think it is not possible. When you're excluding something that are all out of the tracking. May be it is possible to trace all imported files. with the help of codelens (again, I said maybe).

But honestly I can't... May be I am not that much good developer. 😉.
Sorry.... 😞

@AbstractFlame
Copy link

Hi Ritwickdey!

Respect for this extension, I like it so much.

I miss the exactly same funcionality so much.
That would be nice if I save a scss file then all scss file have compiled. That would solve everything for me and make this extension more awesome. You could save a lot of development time and annoying routins.

Are you this much good developer? (I guess you are)

@dayanbarros
Copy link

I Ritwickdey!

I need this too. If you could resolve this problem, I will thank you to forever

@JiriPatroch
Copy link

Hi Ritwickdey!
Really good job with this extension!! I find it really helpfull :-)

@everyone:
Maybe this solution will what you are loking for:

  1. In your main.scss file import all files you want to compile. For example:
//main.scss file
@import 'header';
@import 'body';
@import 'footer';
  1. All file names of this imported .scss in your directory must be prefixed with "_". For example:
    _header.scss
    _body.scss
    _footer.scss

main.scss - will be only one file without prefix

  1. run Live Sass Compiler
    You will see that only the main.scss will be compiled into main.css and it will contain styles from all imported scss files. Also the Live Sass Compiler will be still tracking for changes in this imported files. So whenever you will make change in your _header/_body/_footer.scss, the main.css file will be recompiled.

Hope it will help you.. For me this works fine.

@xobjects
Copy link

xobjects commented Sep 3, 2020

Sorry, I know the last post is over a year old, but two things. I was having this problem as well and the solution from @JiriPatroch worked well. so, thank you. However, why does this work?

Also, will there, in a future release, be a setting to allow for entry point scss files and have it build a dependency tree based on that?

@ccc-nghia-le
Copy link

@JiriPatroch that works beautifully. Thank you.

@VoDuyHung
Copy link

Hi Ritwickdey!
Really good job with this extension!! I find it really helpfull :-)

@everyone:
Maybe this solution will what you are loking for:

  1. In your main.scss file import all files you want to compile. For example:
//main.scss file
@import 'header';
@import 'body';
@import 'footer';
  1. All file names of this imported .scss in your directory must be prefixed with "_". For example:
    _header.scss
    _body.scss
    _footer.scss

main.scss - will be only one file without prefix

  1. run Live Sass Compiler
    You will see that only the main.scss will be compiled into main.css and it will contain styles from all imported scss files. Also the Live Sass Compiler will be still tracking for changes in this imported files. So whenever you will make change in your _header/_body/_footer.scss, the main.css file will be recompiled.

Hope it will help you.. For me this works fine.

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants