diff --git a/config.xml b/config.xml
index b85d51b42..796a5978a 100644
--- a/config.xml
+++ b/config.xml
@@ -18,6 +18,7 @@
+
diff --git a/scripts/cordova-hooks/before_plugin_add.sh b/scripts/cordova-hooks/before_plugin_add.sh
new file mode 100755
index 000000000..3139de83d
--- /dev/null
+++ b/scripts/cordova-hooks/before_plugin_add.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [[ $CORDOVA_PLUGINS == *cordova-plugin-moodleapp* ]]; then
+ echo "Building cordova-plugin-moodleapp"
+
+ cd cordova-plugin-moodleapp
+ npm run prod
+fi