From 75eb5b1711287f1644579d6ffe62aaeeae32d133 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 19 Jul 2018 18:14:56 -0400 Subject: [PATCH] fix: plugin generator should be optional close #1896 --- packages/@vue/cli/lib/Creator.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/@vue/cli/lib/Creator.js b/packages/@vue/cli/lib/Creator.js index 4e2c08939..f84065bbe 100644 --- a/packages/@vue/cli/lib/Creator.js +++ b/packages/@vue/cli/lib/Creator.js @@ -307,10 +307,7 @@ module.exports = class Creator extends EventEmitter { rawPlugins = sortObject(rawPlugins, ['@vue/cli-service']) const plugins = [] for (const id of Object.keys(rawPlugins)) { - const apply = loadModule(`${id}/generator`, this.context) - if (!apply) { - throw new Error(`Failed to resolve plugin: ${id}`) - } + const apply = loadModule(`${id}/generator`, this.context) || (() => {}) let options = rawPlugins[id] || {} if (options.prompts) { const prompts = loadModule(`${id}/prompts`, this.context)