From 083f4c26bf905d17a54c07a6fc2e40eaee0d38fb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 8 Dec 2016 20:33:57 +0330 Subject: [PATCH] [webpack] include project `node_modules` dir --- lib/build/webpack/base.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/build/webpack/base.config.js b/lib/build/webpack/base.config.js index d872068ae8..73e706e82c 100644 --- a/lib/build/webpack/base.config.js +++ b/lib/build/webpack/base.config.js @@ -2,7 +2,7 @@ const vueLoaderConfig = require('./vue-loader.config') const { defaults } = require('lodash') -const { join } = require('path') +const { join, resolve } = require('path') const { urlJoin } = require('../../utils') /* @@ -14,7 +14,8 @@ const { urlJoin } = require('../../utils') |-------------------------------------------------------------------------- */ module.exports = function () { - const nodeModulesDir = join(__dirname, '..', '..', '..', 'node_modules') + const nodeModulesDir = resolve(__dirname, '..', '..', '..', 'node_modules') + const projectNodeModulesDir = resolve(nodeModulesDir, '..', '..', '..', 'node_modules') let config = { devtool: 'source-map', entry: { @@ -39,12 +40,14 @@ module.exports = function () { }, modules: [ nodeModulesDir, + projectNodeModulesDir, join(this.dir, 'node_modules') ] }, resolveLoader: { modules: [ nodeModulesDir, + projectNodeModulesDir, join(this.dir, 'node_modules') ] },