inlines babel-messages on the following files:

option-manager.js... /babel-core/src/config/
 build-external-helpers.js... /packages/babel-core/src/tools/
 index.js... /packages/babel-generator/src
This commit is contained in:
rouzbeh84 2017-09-29 22:22:49 -07:00
parent 0e432f0e0d
commit aaeebfaf00
3 changed files with 4 additions and 6 deletions

View File

@ -2,7 +2,6 @@
import * as context from "../index"; import * as context from "../index";
import Plugin from "./plugin"; import Plugin from "./plugin";
import * as messages from "babel-messages";
import defaults from "lodash/defaults"; import defaults from "lodash/defaults";
import merge from "lodash/merge"; import merge from "lodash/merge";
import removed from "./removed"; import removed from "./removed";
@ -334,7 +333,7 @@ function instantiatePlugin({ value: pluginObj, descriptor }) {
Object.keys(pluginObj).forEach(key => { Object.keys(pluginObj).forEach(key => {
if (!ALLOWED_PLUGIN_KEYS.has(key)) { if (!ALLOWED_PLUGIN_KEYS.has(key)) {
throw new Error( throw new Error(
messages.get("pluginInvalidProperty", descriptor.alias, key), `Plugin ${descriptor.alias} provided an invalid property of ${key}`,
); );
} }
}); });

View File

@ -1,6 +1,5 @@
import * as helpers from "babel-helpers"; import * as helpers from "babel-helpers";
import generator from "babel-generator"; import generator from "babel-generator";
import * as messages from "babel-messages";
import template from "babel-template"; import template from "babel-template";
import * as t from "babel-types"; import * as t from "babel-types";
@ -178,7 +177,7 @@ export default function(
if (build) { if (build) {
tree = build(namespace, builder); tree = build(namespace, builder);
} else { } else {
throw new Error(messages.get("unsupportedOutputType", outputType)); throw new Error(`Unsupported output type ${outputType}`);
} }
return generator(tree).code; return generator(tree).code;

View File

@ -1,5 +1,4 @@
import SourceMap from "./source-map"; import SourceMap from "./source-map";
import * as messages from "babel-messages";
import Printer, { type Format } from "./printer"; import Printer, { type Format } from "./printer";
/** /**
@ -74,7 +73,8 @@ function normalizeOptions(code, opts): Format {
if (format.compact) { if (format.compact) {
console.error( console.error(
"[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB"), `[BABEL] Note: The code generator has deoptimised the styling of ${opts.filename},
it exceeds the max of 500KB.`,
); );
} }
} }