Grunt with Compass and Watch compiles slow

后端 未结 4 1738
既然无缘
既然无缘 2021-02-15 09:23

Grunt takes a quite long to compile the css file, I am not sure if this is normal but regular compass watch takes around 5 seconds.

So the question is if there is any w

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-15 10:13

    Along with what Simon mentioned about the watch option of grunt-contrib-compass, you can use grunt-concurrent to run two processes, effectively grunt watch and compass watch, alongside each other:

    concurrent: {
        watch: {
            tasks: ['watch', 'compass:watch'],
            options: {
                logConcurrentOutput: true
            }
        }
    },
    compass: {
        watch: {
            options: {
                watch: true
            }
        }
    }
    

    If you want to run compass from Grunt when building, deploying, or anything else that requires compile instead of watch, you'll need to make a second compass task and use that:

    compass: {
        // Compass grunt module requires a named target property with options.
        compile: {
            options: {}
        }
    }
    

提交回复
热议问题