Only set options in cli if different from default (#4507)
* CLI: Only set options if different from default Currently default values (like comments: true) will be set always for the transform. This behaviour dos not allow for setting this options from babelrc as the default would always have precedence. * Add new tests for comments Also ensure that the babelrc in the fixture folder is copied over to the working directory during tests
This commit is contained in:
committed by
Henry Zhu
parent
993f887240
commit
ff78fb19f7
@@ -107,7 +107,7 @@ if (errors.length) {
|
||||
let opts = exports.opts = {};
|
||||
|
||||
each(options, function (opt, key) {
|
||||
if (commander[key] !== undefined) {
|
||||
if (commander[key] !== undefined && commander[key] !== opt.default) {
|
||||
opts[key] = commander[key];
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user