diff --git a/lib/core/nuxt.js b/lib/core/nuxt.js index b0b9d08bde..bc7d8c524c 100644 --- a/lib/core/nuxt.js +++ b/lib/core/nuxt.js @@ -94,6 +94,15 @@ export default class Nuxt extends Tapable { } resolvePath (path) { + // Try to resolve using NPM resolve path first + // Fixes problems with scopped modules + try { + let resolvedPath = require.resolve(path) + return resolvedPath + } catch (e) { + // Just continue + } + // Shorthand to resolve from project srcDir if (path.indexOf('@') === 0 || path.indexOf('~') === 0) { if (path.indexOf('~') === 0) {