From d3717279f9d25d2d02114156987d9b91ff4aa0e6 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 17 Oct 2020 12:52:13 -0400 Subject: [PATCH] Ensure changes to withOptions plugins trigger rebuilds --- src/util/createPlugin.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/createPlugin.js b/src/util/createPlugin.js index 8d4fba11c..e2c55dcdb 100644 --- a/src/util/createPlugin.js +++ b/src/util/createPlugin.js @@ -15,6 +15,11 @@ createPlugin.withOptions = function(pluginFunction, configFunction = () => ({})) optionsFunction.__isOptionsFunction = true + // Expose plugin dependencies so that `object-hash` returns a different + // value if anything here changes, to ensure a rebuild is triggered. + optionsFunction.__pluginFunction = pluginFunction + optionsFunction.__configFunction = configFunction + return optionsFunction }