我已经安装并尝试了grunt-react和grunt-contrib-imagemin任务。我已经设置了以下Gruntfile.js。
module.exports = function(grunt) {
grunt.initConfig ({
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'public',
src: ['development/images/*.{png,jpg,gif}'],
dest: 'images'
}],
options: {
cache: false
}
}
},
react: {
single_file_output: {
files: {
'bundle.jsx': 'login.jsx'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-react');
grunt.registerTask('imagemin', ['imagemin']);
grunt.registerTask('react', ['react']);
};在命令行中,我以grunt react或grunt imagemin的形式启动任务。传递--verbose CLI标志后,Grunt报告所有检查都是OK。然而,这两项任务都无限期地运行。他们永远不会结束。请帮帮我。
这是我的Grunt版本信息:
grunt-cli v0.1.13
grunt v0.4.5下面是命令行的输出:
Running "react" task这是反复使用--verbose标志打印的。
发布于 2015-06-05 08:07:07
通过更改以下内容,我能够让它工作起来:
grunt.registerTask('reactify', ['react']);我更改了任务的名称。我认为,由于内部设计的周期性,它会导致不确定的执行。
https://stackoverflow.com/questions/30660690
复制相似问题