[webpack] include project node_modules dir

This commit is contained in:
Pooya Parsa 2016-12-08 20:33:57 +03:30 committed by GitHub
parent 8db6964dc5
commit 083f4c26bf

View File

@ -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')
]
},