Skip to content

Commit

Permalink
Add NODE_PATH support for resolveLoaders as well. (#778)
Browse files Browse the repository at this point in the history
* Add NODE_PATH support for resolveLoaders as well.

* Remove unwanted code.
  • Loading branch information
arunoda authored and nkzawa committed Jan 16, 2017
1 parent 0d6ceec commit 60ec4de
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions server/build/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export default async function createCompiler (dir, { dev = false, quiet = false
)
}

const nodePathList = (process.env.NODE_PATH || '')
.split(process.platform === 'win32' ? ';' : ':')
.filter((p) => !!p)

const mainBabelOptions = {
babelrc: true,
cacheDirectory: true,
Expand Down Expand Up @@ -185,18 +189,16 @@ export default async function createCompiler (dir, { dev = false, quiet = false
resolve: {
modules: [
nextNodeModulesDir,
'node_modules'
].concat(
(process.env.NODE_PATH || '')
.split(process.platform === 'win32' ? ';' : ':')
.filter((p) => !!p)
)
'node_modules',
...nodePathList
]
},
resolveLoader: {
modules: [
nextNodeModulesDir,
'node_modules',
join(__dirname, 'loaders')
join(__dirname, 'loaders'),
...nodePathList
]
},
plugins,
Expand Down

0 comments on commit 60ec4de

Please sign in to comment.