【发布时间】:2014-12-12 11:58:25
【问题描述】:
不知道如何嵌套 grunt watch 和 stylus 编译器(livereload 稍后会出现)
我也尝试过使用“新”的 grunt newer,但我的代码一定有问题。
有什么建议吗?
grunt.initConfig({
stylus: {
compile: {
options: {
paths: ['stylus'],
import: [
'nib/*'
]
},
files: {
'css/style.css': 'stylus/style.styl',
},
},
},
watch: {
stylus: {
files: ['*/*.*'],
task: ['newer:stylus:compile'],
options : { livereload: true },
},
},
});
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-newer');
grunt.registerTask('compile', ['newer:stylus:all']);
另外,如果我运行grunt watch,它运行良好但什么也不做。
而且,如果我运行 grunt stylus,它会完美地编译我的 css。
【问题讨论】:
标签: javascript gruntjs stylus