serverless/lib/cli/conditionally-load-dotenv.js
2024-05-29 11:51:04 -04:00

10 lines
302 B
JavaScript

import _ from 'lodash'
export default async (options, configuration) => {
const stage = options.stage || _.get(configuration, 'provider.stage', 'dev')
if (!configuration.useDotenv) return false
const { default: loadDotenv } = await import('./load-dotenv.js')
loadDotenv(stage)
return true
}