【发布时间】:2014-06-20 21:41:56
【问题描述】:
我刚刚开始使用 grunt,只是尝试完成一些基本任务。 这是我的 Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config.rb',
watch: true
}
}
},
livecopy: {
your_target: {
options: {
source: "C:/Websites/xxx/styles/screen.css",
target: "W:/Websites/xxx/styles/screen.css"
},
},
},
watch: {
assets: {
files: ['**//*.css', '**/*.js'],
options: {
livereload: true,
},
},
},
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-livecopy');
grunt.task.registerTask('default', ['compass','livecopy','watch']);
};
我可以单独运行这些任务中的每一个,而不会出现任何问题。当我运行 grunt 默认任务时,只有默认任务列表中的第一个任务运行。它们的顺序无关紧要,只有第一个运行。
我错过了什么?
【问题讨论】:
标签: gruntjs