使用gulp编译所有子文件夹中的所有scss文件

编程入门 行业动态 更新时间:2024-10-13 00:35:41
本文介绍了使用gulp编译所有子文件夹中的所有scss文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

|模板我有这个angular2项目结构(显示出问题的部分) | index -index.scss -index.template.html |关于 -about.scss -about.template.html code>

我想使用gulp编译索引中的所有scss文件,并将编译后的文件放在与scss相同的目录中文件。 示例:必须编译 index.scss并将其作为index.css 放入索引(文件夹)中,以便结果为

|模板 |索引 -index.scss -index.css -index.template.html

如何使用gulp编译所有模板子文件夹中的所有scss文件,并且编译后的文件必须放在同一子文件夹中作为scss文件吗?

解决方案

尝试此代码

$ b

gulp.task('sass-style',function(){ return sass('templates / folder / ** / *。scss') .on('error',sass.logError) .pipe(gulp.dest(''templates / folder /')); });

I have this angular2 project structure (showing the part where i have the problem ) :

|templates |index -index.scss -index.template.html |About -about.scss -about.template.html

I want to compile all scss files in index and about folders using gulp, and put the compiled files in the same directory as the scss files. Example : index.scss must be compiled and placed in index (folder) as index.css so that the result will be

|templates |index -index.scss -index.css -index.template.html

how could I compile all of scss files in all templates subfolders using gulp, and the compiled files must be placed in the same subfolder as the scss file ?

解决方案

Try this Code

gulp.task('sass-style', function() { return sass('templates/folder/**/*.scss') .on('error', sass.logError) .pipe(gulp.dest(''templates/folder/')); });

更多推荐

使用gulp编译所有子文件夹中的所有scss文件

本文发布于:2023-05-28 00:43:44,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:词库加载错误:Could not find file 'D:\淘小白 高铁采集器win10\Configuration\Dict_Sto

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!