Remove the sourceMapTarget option from core and implement it in babel-cli. (#7500)

This commit is contained in:
Logan Smyth
2018-03-09 14:14:25 -08:00
committed by GitHub
parent 0389035e15
commit b5e6536f26
16 changed files with 20 additions and 27 deletions

View File

@@ -119,9 +119,6 @@ const COMMON_VALIDATORS: ValidatorSet = {
sourceMap: (assertSourceMaps: Validator<
$PropertyType<ValidatedOptions, "sourceMap">,
>),
sourceMapTarget: (assertString: Validator<
$PropertyType<ValidatedOptions, "sourceMapTarget">,
>),
sourceFileName: (assertString: Validator<
$PropertyType<ValidatedOptions, "sourceFileName">,
>),
@@ -192,7 +189,6 @@ export type ValidatedOptions = {
// Sourcemap generation options.
sourceMaps?: SourceMapsOption,
sourceMap?: SourceMapsOption,
sourceMapTarget?: string,
sourceFileName?: string,
sourceRoot?: string,

View File

@@ -44,7 +44,8 @@ export default {
message: "Put the specific transforms you want in the `plugins` option",
},
sourceMapName: {
message: "Use the `sourceMapTarget` option",
message:
"The `sourceMapName` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
},
stage: {
message:
@@ -64,4 +65,10 @@ export default {
message:
"Generated plugin metadata is always included in the output result",
},
sourceMapTarget: {
version: 6,
message:
"The `sourceMapTarget` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
},
};

View File

@@ -15,7 +15,6 @@ export default function normalizeOptions(config: ResolvedConfig): {} {
sourceRoot = moduleRoot,
sourceFileName = filenameRelative,
sourceMapTarget = filenameRelative,
comments = true,
compact = "auto",
@@ -47,7 +46,6 @@ export default function normalizeOptions(config: ResolvedConfig): {} {
// Source-map generation flags.
sourceMaps,
sourceMapTarget,
sourceRoot,
sourceFileName,
},