Grunt with Compass and Watch compiles slow

后端 未结 3 1036
盖世英雄少女心
盖世英雄少女心 2021-02-15 09:38

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

3条回答
  •  礼貌的吻别
    2021-02-15 10:15

    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: {}
        }
    }
    

提交回复
热议问题