Skip to content

It should be clarified that Files should be declared within targets #238

Open
@dustincleveland

Description

@dustincleveland

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions