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

(experimental) Support grunt-contrib-watch style files: srcArray #1203

Closed

Conversation

jpommerening
Copy link

I'm not sure if this breaks some tasks, but couldn't Grunt support the grunt-contrib-watch style of specifying files? When I started using Grunt I found it pretty confusing to have this one "blessed" watch plugin that is used everywhere but that is configured differently from every other plugin.

Do you think the benefits outweigh the downside of having to support yet another way of specifying files? (TBH it's just treating files like src in case files contains strings)

Ex: increasing levels of detail/verbosity in target.files

// new / grunt-contrib-watch style
target1: {
  files: ['**/*.js']
},
// files object
target2: {
  files: { 'dist/file.js': ['**/*.js'] }
},
// files objects in array
target3: {
  files: [
    { 'dist/file-a.js': ['a/**/*.js'] },
    { 'dist/file-b.js': ['b/**/*.js'] }
  ]
},
// files array
target4: {
  files: [
    { src: 'dist/file-a.js', dest: ['a/**/*.js'], /* ... */ },
    { src: 'dist/file-b.js', dest: ['b/**/*.js'], /* ... */ }
  ]
}

Add support for files arrays that contain only the plain src strings:

    target: {
      files: ['**/*.js', '**/*.css']
    }
@shama
Copy link
Member

shama commented Nov 24, 2015

I believe the rest of the Grunt team was agreeing they wanted less src/dest block style types as its a good source of confusion so I don't think we should add another. If anything, we should just make it more clear the watch task is not a multi task like the other tasks and behaves differently because it operates differently than any other task. But that is the primary reason grunt-contrib-watch's style is different.

Thanks for the PR though! Much appreciated!

@shama shama closed this Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants