diff --git a/src/babel/build-external-helpers.js b/src/babel/build-external-helpers.js index 89fbb08bbd..b96579a27f 100644 --- a/src/babel/build-external-helpers.js +++ b/src/babel/build-external-helpers.js @@ -1,5 +1,6 @@ import buildHelpers from "./build-helpers"; import generator from "./generation"; +import * as messages from "./messages"; import * as util from "./util"; import t from "./types"; @@ -62,7 +63,7 @@ export default function (whitelist, outputType = "global") { } else if (outputType === "var") { tree = buildVar(namespace, builder); } else { - throw new Error("Unsupported output type"); + throw new Error(messages.get("unsupportedOutputType", outputType)); } return generator(tree).code; diff --git a/src/babel/messages.js b/src/babel/messages.js index cf00085320..0f70f1410f 100644 --- a/src/babel/messages.js +++ b/src/babel/messages.js @@ -20,7 +20,8 @@ export var messages = { didYouMean: "Did you mean $1?", evalInStrictMode: "eval is not allowed in strict mode", codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.", - missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues" + missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", + unsupportedOutputType: "Unsupported output type $1" }; export function get(key) {