0

新来的 grunt 我已经成功地用它来运行purifycss. 现在我想purifycss用不同的参数运行两次,然后理想地连接两个结果文件。我到目前为止是这样的Gruntfile

module.exports = function(grunt) {

  grunt.initConfig({
    purifycss: {
      bootstrap: {
        options: {},
        target: {
              src: [ 'live/*.twig' ],
              css: ['live/css/bootstrap*.css'],
              dest: 'purified_bootstrap.css'
                }
            },
      mycss: {
        options: {},
        target: {
              src: [ 'live/*.twig' ],
              css: ['live/css/mycss.css'],
              dest: 'purified_mycss.css'
                }
            }
      }
  });

  grunt.loadNpmTasks('grunt-purifycss');
  grunt.registerTask('purify', ['purifycss:bootstrap', 'purifycss:mycss']);
};

从终端运行 grunt purify 时得到的输出:

> grunt purify
Running "purifycss:bootstrap" (purifycss) task
Warning: Cannot call method 'forEach' of undefined Use --force to continue.
Aborted due to warnings.

对这里出了什么问题的任何帮助表示赞赏!

4

0 回答 0