Coarse jade bug

Whenever I start grunting, I get an error message:

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 try to take the jade files in src/static/jade(except subdirs _include) and put them in build, keeping the directory structure. I tried to comment out a line expand, however this gives me:

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

Maybe I'm wrong. How to fix it?

+4
source share
1 answer

Your initial problem lies in the fact, that filesshould be an array of objects, and not just an object: files: [{...}].

But then you have other problems with defining your file:

  • cwd, src
  • ext .
  • ! pattern dir

, :

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

Source: https://habr.com/ru/post/1611353/


All Articles