how to compile multiple scss files into multiple css files with grunt-sass?

纵饮孤独 提交于 2021-02-08 10:37:20

问题


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 ).

that kind of functionality that can be found in Prepros.

is it possible to do it with grunt-sass?

i tried this but it doesn't work:

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

回答1:


You can try:

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



回答2:


You need to build your file object dynamically, see here: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically



来源:https://stackoverflow.com/questions/32690321/how-to-compile-multiple-scss-files-into-multiple-css-files-with-grunt-sass

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!