diff --git a/experimental/babel-preset-env/src/normalize-options.js b/experimental/babel-preset-env/src/normalize-options.js index 10186c7da3..b09826e9e5 100644 --- a/experimental/babel-preset-env/src/normalize-options.js +++ b/experimental/babel-preset-env/src/normalize-options.js @@ -4,8 +4,6 @@ import defaultInclude from "./default-includes"; import moduleTransformations from "./module-transformations"; import pluginFeatures from "../data/plugin-features"; -const hasBeenWarned = false; - const validIncludesAndExcludes = [ ...Object.keys(pluginFeatures), ...Object.keys(moduleTransformations).map((m) => moduleTransformations[m]), @@ -13,6 +11,8 @@ const validIncludesAndExcludes = [ ...defaultInclude ]; +let hasBeenWarned = false; + export const validateIncludesAndExcludes = (opts = [], type) => { invariant( Array.isArray(opts), @@ -76,6 +76,7 @@ export default function normalizeOptions(opts) { `Deprecation Warning: The "whitelist" option has been deprecated in favor of "include" to match the newly added "exclude" option (instead of "blacklist").` ); + hasBeenWarned = true; } invariant(