How to create a new empty file in a Grunt task?
I want to set up a project and create a new file in the process. The file will be empty. I don't want to use unnecessary plugins that are not intended for this purpose.
Is there a simple way to do such thing?
You could use grunt.file.write:
grunt.registerTask('emptyFile', 'Creates an empty file', function() {
grunt.file.write('path/to/file', '');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With