grunt 系列

grunt 配合 browserSync 实现跨文件夹改动文件而进行实时刷新

代码:

module.exports = function(grunt){

    grunt.initConfig({
        browserSync : {
            test : {
                options : {
                    watchTask: true,
                    server : ""

                },
                bsFiles : {
                    src : ["css/*.css",    "*.html", 'scripts/*.js']
                }
            }
        },
        watch:{
            files : ['css/*.css', 'scripts/*.js', '*.html'],
        }

    });

    grunt.loadNpmTasks('grunt-browser-sync');
    grunt.loadNpmTasks('grunt-contrib-watch');


    grunt.registerTask("default", ['browserSync', 'watch']);

}

posted @ 2015-09-24 13:38  记忆城主  阅读(100)  评论(0编辑  收藏  举报