Trying to compile all scss files into a single css file

I have a grunt file, but I am having trouble compiling it. When I look, it works fine, but does not create any files.

What am I missing?

module.exports = function(grunt) { grunt.initConfig({ pngmin: { compile: { options: { ext: '.png', force: true, speed: 3, colors: 200 }, files: [{ expand: true, // required option src: ['**/*.png'], cwd: 'public/images/src/', // required option dest: 'public/images/dist/' }] } }, sass: { dist: { files: [ { expand: true, cwd: "public/sass", src: ["**/*.sass"], dest: "public/stylesheets", ext: ".css" } ] } }, watch: { css: { files: '**/*.scss', tasks: ['sass'] } } }); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-pngmin'); grunt.registerTask('default', ['pngmin', 'watch', 'sass']); }; 
+6
source share
1 answer

You look at scss files, but you have sass files in sass .

Assuming you are using sass files, you need to change the code to something like this:

  sass: { dist: { files: [ { expand: true, cwd: "public/sass", src: ["**/*.sass"], dest: "public/stylesheets", ext: ".css" } ] } }, watch: { css: { files: '**/*.sass', tasks: ['sass'] } } 

Sincerely.

+2
source

Source: https://habr.com/ru/post/974254/


All Articles