Remove the resolveModuleSource options.

This commit is contained in:
Logan Smyth
2017-09-29 12:30:30 -07:00
parent 8339e036bf
commit 3bac67b4b9
6 changed files with 12 additions and 51 deletions

View File

@@ -57,7 +57,6 @@ const optionNames = new Set([
"sourceType",
"auxiliaryCommentBefore",
"auxiliaryCommentAfter",
"resolveModuleSource",
"getModuleId",
"moduleRoot",
"moduleIds",
@@ -450,9 +449,10 @@ function normalizeOptions(config) {
// check for an unknown option
if (!optionNames.has(key)) {
if (removed[key]) {
const { message, version = 5 } = removed[key];
throw new ReferenceError(
`Using removed Babel 5 option: ${alias}.${key} - ${removed[key]
.message}`,
`Using removed Babel ${version} option: ${alias}.${key} - ${message}`,
);
} else {
// eslint-disable-next-line max-len

View File

@@ -56,4 +56,9 @@ export default {
whitelist: {
message: "Put the specific transforms you want in the `plugins` option",
},
resolveModuleSource: {
version: 6,
message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options",
},
};

View File

@@ -166,11 +166,9 @@ export default class File {
}
}
// TODO: Remove this before 7.x's official release. Leaving it in for now to
// prevent unnecessary breakage between beta versions.
resolveModuleSource(source: string): string {
const resolveModuleSource = this.opts.resolveModuleSource;
if (resolveModuleSource) {
source = resolveModuleSource(source, this.opts.filename);
}
return source;
}