From ffa2f4554b959b9af67d385d85fe9a4c822ad482 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Wed, 21 Nov 2018 09:41:44 -0800 Subject: Takeout redundant check, and make function name more clear --- packages/instant/webpack.config.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js index 466385db9..b08fabedf 100644 --- a/packages/instant/webpack.config.js +++ b/packages/instant/webpack.config.js @@ -67,7 +67,7 @@ const getRollbarPlugin = environmentName => { return new RollbarSourceMapPlugin(rollbarPluginOptions); }; -const validateRollbar = (environmentName, rollbarPlugin) => { +const validateRollbarPresence = (environmentName, rollbarPlugin) => { const requiresRollbar = environmentName === 'dogfood' || environmentName === 'staging'; if (!requiresRollbar) { @@ -79,11 +79,9 @@ const validateRollbar = (environmentName, rollbarPlugin) => { } if (!rollbarPlugin) { - if (environmentName === 'dogfood' || environmentName === 'staging') { - throw new Error( - `Please set rollbar env var ${ROLLBAR_PUBLISH_TOKEN_ENV_NAME} to a Rollbar project access token with post_server_item permissions to deploy source maps to ${environmentName}`, - ); - } + throw new Error( + `Please set rollbar env var ${ROLLBAR_PUBLISH_TOKEN_ENV_NAME} to a Rollbar project access token with post_server_item permissions to deploy source maps to ${environmentName}`, + ); } }; @@ -111,7 +109,7 @@ module.exports = (env, argv) => { } else { console.log('Not using rollbar plugin'); } - validateRollbar(environmentName, rollbarPlugin); + validateRollbarPresence(environmentName, rollbarPlugin); const config = { entry: { -- cgit v1.2.3