From 2afdeac3dfc27c9fde7f8b2861b5b65198231c3f Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Fri, 13 Mar 2020 15:31:52 -0400
Subject: [PATCH] Grunt Customization Template (#1535)

- Adds a mechanism for defining local Grunt tasks.
---
 .gitignore              | 1 +
 Gruntfile.js            | 9 +++++++--
 Gruntfile.local.js.dist | 5 +++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 Gruntfile.local.js.dist

diff --git a/.gitignore b/.gitignore
index 4f1a4bd06fb..f76bd9ff69b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
 .vagrant
 .vscode/*
 /downloads
+/Gruntfile.local.js
 /solr/vendor
 /vendor
 ChangeLog
diff --git a/Gruntfile.js b/Gruntfile.js
index 6447608ad69..07ed2f91640 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,7 +1,12 @@
 module.exports = function(grunt) {
-  require('jit-grunt')(grunt); // Just in time library loading
+  const fs = require("fs");
+
+  // Local custom tasks
+  if (fs.existsSync("./Gruntfile.local.js")) {
+    require("./Gruntfile.local.js")(grunt);
+  }
 
-  var fs = require('fs');
+  require('jit-grunt')(grunt); // Just in time library loading
 
   /**
    * @param  {string} file
diff --git a/Gruntfile.local.js.dist b/Gruntfile.local.js.dist
new file mode 100644
index 00000000000..31083b47976
--- /dev/null
+++ b/Gruntfile.local.js.dist
@@ -0,0 +1,5 @@
+module.exports = function(grunt) {
+  grunt.registerTask("custom", function customFunc() {
+    grunt.log.writeln("Hello world!");
+  });
+}
-- 
GitLab