View and collect the entire folder using node-sass?

Compass has an excellent command that will observe and compile all scss in a given directory:

compass watch *foldername*

However, a Ruby-based compass is slow, and SASSC in C wrapped in a node-sass form is much faster. The fact is that I could not reproduce this seemingly simple function using node-sass.

I followed the directions given here: http://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/ , which do a great job of setting up a node sass with grunts, to look for file changes, but does not seem to support viewing and converting the entire folder, agnostic of file names inside.

I tried changing

sass: {
        dist: {
            files: {
                'css/styles.css': 'sass/styles.scss'
            }
        }
    }

, , . , .

compass watch *folder*

sass --watch *folder*:*folder*

, ?

+4
3

, , , "". :

    sass: {
        dist: {
            files: [{
                expand: true,
                src: ['sitecontent/**/*.{scss,sass}'],
                ext: '.css'
            }]
        }
    }

sass sitecontent css sass - - .

+1

grunt-sass grunt-contrib-watch, . , , - ++.

+1

You can use something like this:

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

Hope this was what you were looking for

0
source

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


All Articles