Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 改进grunt设置和速度_Javascript_Gruntjs - Fatal编程技术网

Javascript 改进grunt设置和速度

Javascript 改进grunt设置和速度,javascript,gruntjs,Javascript,Gruntjs,我是grunt新手,我有一个简单的grunt设置,可以编译我的sass和jade并自动重新加载我的浏览器。这个配置不是很快,我必须等待5-7秒来检测更改和自动重新加载。有没有办法提高速度 我的Grunfile.js module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jade: { compi

我是grunt新手,我有一个简单的grunt设置,可以编译我的sass和jade并自动重新加载我的浏览器。这个配置不是很快,我必须等待5-7秒来检测更改和自动重新加载。有没有办法提高速度

我的Grunfile.js

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        jade: {
            compile: {
                options: {
                    pretty: true,
                    nospawn: false
                },

                files: {
                    'index.html' : 'src/index.jade'
                }
            }
        },

        sass: {
            dist: {
                options: {
                    style: 'expanded',
                    nospawn: false
                },

                files: {
                    'build/css/app.css' : 'src/sass/app.sass'
                }
            },

            fin: {
                options: {
                    style: 'compressed',
                    nospawn: false
                },

                files: {
                    'build/css/app.css' : 'src/sass/app.sass'
                }
            }
        },

        watch: {
            jade: {
                files: 'src/**/*.jade',
                tasks: ['jade']
            },

            css: {
                files: 'src/sass/**/*.sass',
                tasks: ['sass:dist']
            },

            options: {
                livereload: true,
                nospawn: false
            }
        },

        connect: {
            server: {
                options: {
                    port: 9000,
                    base: '.',
                    hostname: '0.0.0.0',
                    protocol: 'http',
                    livereload: true,
                    open: true
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-newer');
    grunt.loadNpmTasks('grunt-contrib-jade');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.registerTask('default', ['connect', 'newer:watch']);
};

尝试不使用
grunt-newer插件
我使用grunt-newer插件使其速度更快,但无论是否使用,我的速度都相同。尝试不使用
grunt-newer插件
我使用grunt-newer插件使其速度更快,但无论是否使用,我的速度都相同。