簡體   English   中英

咕嚕玉錯誤

[英]Grunt jade error

每當我運行咕嚕翡翠時,我都會收到錯誤:

Warning: pattern.indexOf is not a function Use --force to continue.

現在這是我的玉任務:

    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/'
            }
        }
    }

所以基本上我試圖在src/static/jade (包括子目錄,除了_include )中獲取jade文件並將它們放在build ,保持目錄結構。 我試過評論expand線,但它給了我:

 Warning: Unable to read "src/static/jade" file (Error code: EISDIR). Use --force to continue.

也許我會以錯誤的方式解決這個問題。 我該怎么解決這個問題?

您最初的問題是files應該是一個對象數組,而不僅僅是一個對象: files: [{...}]

但是你的文件定義還有其他麻煩:

  • 如果你指定cwd ,你的src不應該重復它
  • 你的ext需要一個開始.
  • 您的 ! pattern需要指定文件而不是dir

所以你需要:

files: [{
       expand:true,
       cwd: 'src/static/jade/',
       ext: ".html",
       src: ['**/*.jade', '!_includes/**/*.jade'],
       dest: 'build/'
}]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM