From 5bcca0123a1d58974a10873222abe2b2a1b521b9 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Wed, 23 May 2018 00:50:59 -0700 Subject: [PATCH] Add --env-name option to babel-node, like babel-cli's option. --- packages/babel-node/src/_babel-node.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/babel-node/src/_babel-node.js b/packages/babel-node/src/_babel-node.js index 4742a3189a..24042cd8c0 100644 --- a/packages/babel-node/src/_babel-node.js +++ b/packages/babel-node/src/_babel-node.js @@ -47,6 +47,11 @@ program.option( "--config-file [path]", "Path to the babel config file to use. Defaults to working directory babel.config.js", ); +program.option( + "--env-name [name]", + "The name of the 'env' to use when loading configs and plugins. " + + "Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.", +); program.option("-w, --plugins [string]", "", collect); program.option("-b, --presets [string]", "", collect); @@ -62,6 +67,7 @@ register({ plugins: program.plugins, presets: program.presets, configFile: program.configFile, + envName: program.envName, }); const replPlugin = ({ types: t }) => ({