den*_*min 88 node.js gruntjs grunt-contrib-watch
我正在使用nodejs v0.10.26运行Lion 10.9.2
我想在sass文件上设置自动编译,并使用grunt进行实时重新加载,没有什么复杂但是......
运行时grunt watch我收到以下错误
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
util.js:35
var str = String(f).replace(formatRegExp, function(x) {
^
RangeError: Maximum call stack size exceeded
Run Code Online (Sandbox Code Playgroud)
这是Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'assets/css/styles.css': 'assets/sass/styles.scss'
}
}
},
watch: {
all: {
files: 'index.html', // Change this if you are not watching index.html
options: {
livereload: true // Set livereload to trigger a reload upon change
}
},
css: {
files: [ 'assets/sass/**/*.scss' ],
tasks: [ 'sass' ],
options: {
spawn: false
}
},
options: {
livereload: true // Set livereload to trigger a reload upon change
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('watch', [ 'watch']);
grunt.registerTask('default', [ 'sass', 'watch' ]);
};
Run Code Online (Sandbox Code Playgroud)
这是package.json
{
"name": "application",
"version": "0.0.1",
"private": true,
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-sass": "~0.7.3"
}
}
Run Code Online (Sandbox Code Playgroud)
Bob*_*ler 298
我终于找到了与SASS一样的问题.我在用
grunt.registerTask('sass', [ 'sass']);
Run Code Online (Sandbox Code Playgroud)
诀窍是Grunt似乎不喜欢名字中的重复.当我切换到
grunt.registerTask('styles', [ 'sass']);
Run Code Online (Sandbox Code Playgroud)
一切都按原样运作.
小智 10
我刚刚修复了一个类似的错误"Recursive process.nextTick detected"导致命令:grunt server
解决方案?请改用sudo grunt
| 归档时间: |
|
| 查看次数: |
27646 次 |
| 最近记录: |