mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add NODE_PATH support (#3656)
This commit is contained in:
parent
7e00548b8a
commit
b38c05bc95
|
@ -92,6 +92,11 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support for NODE_PATH
|
||||||
|
const nodePathList = (process.env.NODE_PATH || '')
|
||||||
|
.split(process.platform === 'win32' ? ';' : ':')
|
||||||
|
.filter((p) => !!p)
|
||||||
|
|
||||||
let totalPages
|
let totalPages
|
||||||
|
|
||||||
let webpackConfig = {
|
let webpackConfig = {
|
||||||
|
@ -132,7 +137,8 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer
|
||||||
extensions: ['.js', '.jsx', '.json'],
|
extensions: ['.js', '.jsx', '.json'],
|
||||||
modules: [
|
modules: [
|
||||||
nextNodeModulesDir,
|
nextNodeModulesDir,
|
||||||
'node_modules'
|
'node_modules',
|
||||||
|
...nodePathList // Support for NODE_PATH environment variable
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
next: nextDir,
|
next: nextDir,
|
||||||
|
@ -146,7 +152,8 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer
|
||||||
modules: [
|
modules: [
|
||||||
nextNodeModulesDir,
|
nextNodeModulesDir,
|
||||||
'node_modules',
|
'node_modules',
|
||||||
path.join(__dirname, 'loaders')
|
path.join(__dirname, 'loaders'),
|
||||||
|
...nodePathList // Support for NODE_PATH environment variable
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
|
|
Loading…
Reference in a new issue