diff --git a/lib/plugin.js b/lib/plugin.js index e0e28866a..2a2e797eb 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -91,13 +91,15 @@ class VueLoaderPlugin { // otherwise RuleSet throws error if no option for a given ref is found. if (vueRule.loader || vueRule.loaders) { vueRule.options = { ident } - } else if (vueRule.use) { + } else if (Array.isArray(vueRule.use)) { const use = vueRule.use[vueLoaderUseIndex] if (typeof use === 'string') { vueRule.use[vueLoaderUseIndex] = { loader: use, options: { ident }} } else { use.options = { ident } } + } else if (typeof vueRule.use === 'string') { + vueRule.use = [{ loader: vueRule.use, options: { ident }}] } else { throw new Error( `VueLoaderPlugin Error: this should not happen. Please open an issue ` +