Kai*_*nce 5 javascript node.js gruntjs grunt-contrib-jade
每当我运行咕噜翡翠时,我都会收到错误:
Warning: pattern.indexOf is not a function Use --force to continue.
Run Code Online (Sandbox Code Playgroud)
现在这是我的玉任务:
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/'
}
}
}
Run Code Online (Sandbox Code Playgroud)
所以基本上我正在尝试将jade文件src/static/jade(包括subdirs,除外_include)放入并build保存目录结构.我试过评论这expand条线,但它给了我:
Warning: Unable to read "src/static/jade" file (Error code: EISDIR). Use --force to continue.
Run Code Online (Sandbox Code Playgroud)
也许我会以错误的方式解决这个问题.我该怎么解决这个问题?
Xav*_*our 13
你最初的问题是files应该是一个对象数组,而不仅仅是一个对象:files: [{...}].
但是你的文件定义还有其他麻烦:
cwd,你src不应该重复它ext需要一个开始.所以你需要:
files: [{
expand:true,
cwd: 'src/static/jade/',
ext: ".html",
src: ['**/*.jade', '!_includes/**/*.jade'],
dest: 'build/'
}]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2720 次 |
| 最近记录: |