问题描述
刚刚在Ubuntu 12.04上安装了最新的Grunt。这里是我的gruntfile:
pre $ module $ export $ function $($ g
$ project
grunt.initConfig({
pkg:grunt.file.readJSON('package.json'),
concat:{
幻灯片:{
src:[' src / top.html','src / bottom.html'],
dest:['build / index.html']
}
}
});
//启用插件
grunt.loadNpmTasks('grunt-contrib');
grunt.registerTask('default',['concat:slides']);
}
这会创建build /目录,但会提供以下输出:
我试着在目录上运行chmod 777,因为我认为它可能有些东西与权限有关,但这似乎没有改变任何东西。
如何让Grunt写入build / index.html?
//不工作
dest:['build / index .html']
作为字符串使用,但不是数组:
// Works
dest:'build / index.html'
Just installed latest Grunt on Ubuntu 12.04. Here is my gruntfile:
module.exports = function(grunt){
//project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
slides : {
src : ['src/top.html', 'src/bottom.html'],
dest : ['build/index.html']
}
}
});
//enable plugins
grunt.loadNpmTasks('grunt-contrib');
grunt.registerTask('default', ['concat:slides']);
}
This creates the build/ directory fine, but gives me the output of:
I tried running chmod 777 on the directory, as I thought it might have something to do with permissions, but that didn't seem to change anything.
How can I make it so Grunt will write to build/index.html?
Figured it out:
//Does not work
dest : ['build/index.html']
Works as a string, but not an array:
//Works
dest : 'build/index.html'
这篇关于Grunt Concat无法写入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!