Skip to content

Optional: Don't create an empty file #157

@Ulrikop

Description

@Ulrikop

Hi,
I've got the issue, that the conncat task creats a file, although no source file was found. At my case, I want to prevent that.

I looked for an option to disable that feature. I haven't found one. But I found the request #36 from 2013. akhoury asked for the createEmptyFiles option but no one answered. Since I am not sure if the idea was lost because the issue has already been closed, I create a new one to ask for it.

Do you can offer an option like createEmptyFiles: true/false?

To implement it, you must only do that change on line 114 at concat.js:

if (!options.createEmptyFiles &&/^\s*$/.test(src)) {
  grunt.verbose.write('No content available.')
}
else {
  grunt.file.write(f.dest, src);
  grunt.verbose.write('File ' + chalk.cyan(f.dest) + ' created.');
}

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions