env: Add NUXT_ROOT_DIR env to work with pm2

This commit is contained in:
Sébastien Chopin 2018-09-06 14:27:56 +02:00 committed by GitHub
parent 14e608bf43
commit 17275d52df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ const esm = require('esm')(module, {
}
})
const getRootDir = argv => resolve(argv._[0] || '.')
const getRootDir = argv => resolve(process.env.NUXT_ROOT_DIR || argv._[0] || '.')
const getNuxtConfigFile = argv => resolve(getRootDir(argv), argv['config-file'])
exports.nuxtConfigFile = getNuxtConfigFile