admin管理员组文章数量:1321045
I'm trying to do test to use correctly SASS and I want create a file style.css and that file minify to style.min.css
sass --watch sass/style:css --style pressed
That works well but I need automate proccess doing pile & minify at the same time.
I've found this code in other stackoverflow:
sass --watch sass/style.scss:css/style.css --watch css/style.css:css/style.min.css --style pressed --scss
but now dont work how I want that works. Also at Sass webpage the code is different now on 2020.
I'm not use gulp tool because I think it not neccesary for Wordpress projects.
Anybody may help me?
I'm trying to do test to use correctly SASS and I want create a file style.css and that file minify to style.min.css
sass --watch sass/style:css --style pressed
That works well but I need automate proccess doing pile & minify at the same time.
I've found this code in other stackoverflow:
sass --watch sass/style.scss:css/style.css --watch css/style.css:css/style.min.css --style pressed --scss
but now dont work how I want that works. Also at Sass webpage the code is different now on 2020.
https://sass-lang./documentation/cli/dart-sass#style
I'm not use gulp tool because I think it not neccesary for Wordpress projects.
Anybody may help me?
Share Improve this question edited Apr 27, 2020 at 14:33 Antonio Ángel Estrada Pérez asked Apr 27, 2020 at 11:51 Antonio Ángel Estrada PérezAntonio Ángel Estrada Pérez 1331 silver badge5 bronze badges 2-
Use
node-sass
is faster thansass
Usage is very simplenode-sass ./style.scss ./style.min.css -w --output-style pressed
– Grzegorz T. Commented Apr 27, 2020 at 12:09 - That not works. node-sass: The term 'node-sass' is not recognized as the name of a cmdlet, function, script file or executable program. Correctly if you typed correctly the name or, if you included a path, verify that the path is correct and Try again. – Antonio Ángel Estrada Pérez Commented Apr 27, 2020 at 14:56
1 Answer
Reset to default 8Irrespective of what you're building your site in, if you want total control over pilation/minification/whatever then well, that's what tooling such as gulp is there for.
It looks like you were trying to pile SCSS to CSS to a file, then take that piled CSS file and minify it. That CLI tool won't do that, but it can absolutely do the pilation/pression at the same time, directly from the source SCSS.
Using the binary you're using, this is going to pile and press, taking ./sass/style.scss
and outputting the result to ./css/style.min.css
sass sass/style.scss:css/style.min.css --style pressed
Add --watch
if you want to have it react to file changes in your scss file.
Or perhaps you were trying to get a unminified and a minified version alongside. In that case, you'll simply have to run two mands. Again, gulp is there to automate this process.
Other binaries will have different flags and options, and of course there is the gulp option which I'd certainly remend given you then don't have to remember any lengthy mands and you can share your chosen structure/tasks accross projects.
本文标签: javascriptSASS Output Style automate with minified fileStack Overflow
版权声明:本文标题:javascript - SASS Output Style automate with minified file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742094381a2420457.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论