Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dustincleveland opened this issue Jun 10, 2018 · 0 comments
Open

Comments

@dustincleveland
Copy link

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.

@Krinkle Krinkle transferred this issue from gruntjs/grunt-docs Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants