D
D
Denis2016-06-24 20:32:17
Grunt.js
Denis, 2016-06-24 20:32:17

PostCss and Grunt?

Good afternoon. There was a question about working with postCss.
Let's say there is such a list of postCss plugins in gruntfile.js

postcss: {
      	options: {
      		processors: [
      			require('precss'),
      			require('autoprefixer')({ 
      				browsers: ['Android >=2.1',
    		                   'Chrome >=21',
    		                   'Firefox >=16',
    		                   'Explorer >=8',
    		                   'Edge >=12',
    		                   'iOS >=3.2',
    		                   'Opera >=21',
    		                   'Safari >=4',
    		                   'OperaMobile >=12',
    		                   'OperaMini >=5.0',
    		                   'ChromeAndroid >=46',
    		                   'FirefoxAndroid >=42',
    		                   'ExplorerMobile >=10'] 
              }),
      			require('postcss-flexbugs-fixes'),
      			require('pixrem')(),
                        require('postcss-cssnext'),
                        require('cssnano'),
                        require('postcss-font-magician'),
                        require('postcss-normalize')
          	]
        }

Until the end I can not understand how you can selectively use these plugins?
Let's say there is a task "css" where you can put all the grunt modules that are responsible for working with css. It's clear here.
And in the case of postCss plugins, it turns out that if I set task "postcss", then all plugins will be executed at once. Those. if you go further and set task "postCss" to watch, then all plugins will work with changes, not just those that are responsible for working with css.
Or I don't understand something.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question