如何使用grunt-sass将多个scss文件编译成多个css文件? [英] how to compile multiple scss files into multiple css files with grunt-sass?

查看:75
本文介绍了如何使用grunt-sass将多个scss文件编译成多个css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将scss文件夹中所有未导入的SCSS文件(文件名不是以_开头)编译成单独的CSS文件(与SCSS文件同名).

i would like to compile all SCSS files that are inside scss folder and are not imported ( file names do not start with _ ) each into separate CSS files( that has the same name as SCSS file ).

可以在Prepros中找到的那种功能.

that kind of functionality that can be found in Prepros.

有可能用grunt-sass做到吗?

is it possible to do it with grunt-sass?

我尝试了此方法,但没有用:

i tried this but it doesn't work:

sass: {
  dist: {
    files {
      'css/*.css': 'scss/*.scss',
    }
  }
}

推荐答案

您可以尝试:

sass: {
    dist: {
      files: [{
        expand: true,
        cwd: 'styles',
        src: ['*.scss'],
        dest: '../public',
        ext: '.css'
      }]
    }
}

这篇关于如何使用grunt-sass将多个scss文件编译成多个css文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆