Reputation: 23149
Is there a way to run:
sass --watch a.scss:a.css
but have a.css
end up being minified?
How would I avoid having to run a separate minification step as I compile my stylesheet?
Upvotes: 303
Views: 190677
Reputation: 511
This worked for me :
sass --watch --style=compressed a.scss:a.css
Upvotes: 2
Reputation: 23149
sass --watch a.scss:a.css --style compressed
Consult the documentation for updates:
Upvotes: 658
Reputation: 8055
There are some different way to do that
sass --watch --style=compressed main.scss main.css
or
sass --watch a.scss:a.css --style compressed
or
By Using visual studio code extension live sass compiler
Upvotes: 4
Reputation: 26071
If you are using JetBrains editors like IntelliJ IDEA, PhpStorm, WebStorm etc. Use the following settings in Settings > File Watchers.
Convert style.scss
to style.css
set the arguments
--no-cache --update $FileName$:$FileNameWithoutExtension$.css
and output paths to refresh
$FileNameWithoutExtension$.css
Convert style.scss
to compressed style.min.css
set the arguments
--no-cache --update $FileName$:$FileNameWithoutExtension$.min.css --style compressed
and output paths to refresh
$FileNameWithoutExtension$.min.css
Upvotes: 29
Reputation: 197
If you're using compass:
compass watch --output-style compressed
Upvotes: 13