jwvdiermen / grunt-include-source

Include lists of files into your source files automatically.
MIT License
68 stars 31 forks source link

type: less produces "Cannot call method 'replace' of undefined" #12

Closed crarchitech closed 10 years ago

crarchitech commented 10 years ago

Gruntfile config:

includeSource: {
  options: {
    basePath: 'app',
    baseUrl: 'public/',
    templates: {
      less: {
        less: '@import "{filePath}";',
        css: '@import "{filePath}";'
      }
    }
  },
  app: {
    files: {
      '.tmp/index.html': 'app/index.tpl.html'
    }
  }
}

Index.html:

<!-- include: "type": "less", "files": "styles/**/*.less" -->

"grunt includeSource" produces: TypeError: Cannot call method 'replace' of undefined node_modules\grunt-include-source\tasks\include_source.js:184:64

jwvdiermen commented 10 years ago

What happens when you remove the templates options from your Gruntfile? Since the default template is the same anyway, you don't need it and there might be a bug with merging the templates from the options with the defaults.

jwvdiermen commented 10 years ago

Unit tests have been added. I tried adding your templates config to the task and everything seemed to work fine. I'm closing this issue for now since I can't reproduce it and it's over 2 months old now. If you have any other problems, please reopen this issue.