Javascript 改进grunt设置和速度
我是grunt新手,我有一个简单的grunt设置,可以编译我的sass和jade并自动重新加载我的浏览器。这个配置不是很快,我必须等待5-7秒来检测更改和自动重新加载。有没有办法提高速度 我的Grunfile.jsJavascript 改进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
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插件使其速度更快,但无论是否使用,我的速度都相同。