[英]Grunt jade error
Whenever I run grunt jade I get an error: 每当我运行咕噜翡翠时,我都会收到错误:
Warning: pattern.indexOf is not a function Use --force to continue.
Now here is my jade task: 现在这是我的玉任务:
jade: {
options: {
pretty: true
},
all: {
files: {
expand:true,
cwd: 'src/static/jade',
ext: "html",
src: ['src/static/jade/**/*.jade', '!src/static/jade/_includes'],
dest: 'build/'
}
}
}
So basically I am trying to take the jade files in src/static/jade
(including subdirs, except _include
) and put them in build
, keeping the directory structure. 所以基本上我试图在
src/static/jade
(包括子目录,除了_include
)中获取jade文件并将它们放在build
,保持目录结构。 I have tryed commenting the expand
line, however it gives me: 我试过评论
expand
线,但它给了我:
Warning: Unable to read "src/static/jade" file (Error code: EISDIR). Use --force to continue.
Perhaps I am going about this the wrong way. 也许我会以错误的方式解决这个问题。 How should I fix this?
我该怎么解决这个问题?
Your initial issues is that files
should be an array of objects, not just an object: files: [{...}]
. 您最初的问题是
files
应该是一个对象数组,而不仅仅是一个对象: files: [{...}]
。
But then you have other troubles with your file definition: 但是你的文件定义还有其他麻烦:
cwd
, your src
should not repeat it cwd
,你的src
不应该重复它 ext
needs a starting .
ext
需要一个开始.
So you need: 所以你需要:
files: [{
expand:true,
cwd: 'src/static/jade/',
ext: ".html",
src: ['**/*.jade', '!_includes/**/*.jade'],
dest: 'build/'
}]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.