grunt-docs icon indicating copy to clipboard operation
grunt-docs copied to clipboard

It should be clarified that Files should be declared within targets

Open dustincleveland opened this issue 7 years ago • 0 comments

I couldn't figure out why the files settings I was trying to use with Uglify were seemingly ignored. Then, I read the following from this Gist:

... generally defining files at the task-level is bad practice, and often won't work ...

What the heck?

The Configuring Tasks page suggests that you can (not that you must) have multiple targets for multi-tasks.

Multi-tasks can have multiple configurations, defined using arbitrarily named "targets."

And Sample Gruntfile even shows usage of files directly beneath a task:

...
jshint: {
    files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js']
....

I can't find anywhere in the Grunt or Uglify documentation that files should be declared within a target. Targets are, as far as I can tell from the documentation, totally optional. Therefore, I would have no expectation that my gruntfile was working unexpectedly because I didn't wrap files within a target.

I think it would be really helpful to clarify this fact (prominently) in the documentation; or maybe even add a Best Practices page.

dustincleveland avatar Jun 10 '18 00:06 dustincleveland