diff --git a/package.json b/package.json index f4e2eb725..d974a78d4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "e2e": "NODE_ENV=test nightwatch", "poste2e": "NODE_ENV=test scripts/poste2e.sh", "embed-start": "NODE_ENV=development yarn build && ./bin/cli serve --jobs", - "heroku-postbuild": "yarn build" + "heroku-postbuild": "./bin/cli plugins reconcile && yarn build" }, "config": { "pre-git": { diff --git a/plugins.js b/plugins.js index 02cdb58e1..65e80dee5 100644 --- a/plugins.js +++ b/plugins.js @@ -124,7 +124,12 @@ function itteratePlugins(plugins) { // Add each plugin folder to the allowed import path so that they can import our // internal dependancies. Object.keys(plugins).forEach((type) => itteratePlugins(plugins[type]).forEach((plugin) => { - amp.enableForDir(path.dirname(plugin.path)); + + // The plugin may be remote, and therefore not installed. We check here if the + // plugin path is available before trying to monkeypatch it's require path. + if (plugin.path) { + amp.enableForDir(path.dirname(plugin.path)); + } })); /**