问题描述
|模板
我有这个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.cssso 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文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!