gruntjs / grunt-contrib-pug

Compile Pug templates.
http://gruntjs.com/
MIT License
328 stars 77 forks source link

expand with pug not working #162

Open mbalandis opened 8 years ago

mbalandis commented 8 years ago

Getting error: Running "pug:compile" (pug) task Warning: undefined is not a function Use --force to continue.

             config
                    files: {
                    expand: true,
                    cwd: 'pug',
                    src: '**/*.pug',
                    dest: 'dest',
                        ext: '.html'
                 }

after looking at closed cases this seemed to work with jade but I am using jade renamed as pug. Any ideas? Adding file one by one is tedious.

RyanParsley commented 8 years ago

I was just noticing that that's not covered in the readme and was hoping the configuration was just overlooked in documentation.

StephenMcConnel commented 7 years ago

The format below works. Note the square brackets -- files is apparently an array object, not a scalar object. The same is true of src.

   files: [ {
      expand: true,
      src: [ 'src/app/modules/**/*.tpl.pug' ],
      dest: 'build/tmp/',
      ext: '.tpl.html'
    } ]

See http://gruntjs.com/configuring-tasks, and search for dynamic src-dest file mappings.