[@babel/cli] Copy ignored files by default (#11063)
This commit restores the pre-7.8.0 behavior of the --copy-files option, by making --copy-ignored default to true when --copy-files is enabled.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
a;
|
||||
@@ -0,0 +1 @@
|
||||
a;
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"--out-dir",
|
||||
"lib",
|
||||
"--copy-files",
|
||||
"--copy-ignored",
|
||||
"--no-copy-ignored",
|
||||
"--verbose"
|
||||
]
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
"--out-dir",
|
||||
"lib",
|
||||
"--copy-files",
|
||||
"--copy-ignored",
|
||||
"--no-copy-ignored",
|
||||
"--verbose"
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
"--copy-files",
|
||||
"--ignore",
|
||||
"src/foo",
|
||||
"--copy-ignored",
|
||||
"--no-copy-ignored",
|
||||
"--verbose"
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
"--copy-files",
|
||||
"--only",
|
||||
"src/foo/*",
|
||||
"--copy-ignored",
|
||||
"--no-copy-ignored",
|
||||
"--verbose"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
1
packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js
vendored
Normal file
1
packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bar;
|
||||
1
packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js
vendored
Normal file
1
packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
index;
|
||||
@@ -94,20 +94,21 @@ const assertTest = function(stdout, stderr, opts, cwd) {
|
||||
const actualFiles = readDir(tmpLoc, fileFilter);
|
||||
|
||||
Object.keys(actualFiles).forEach(function(filename) {
|
||||
if (
|
||||
// saveInFiles always creates an empty .babelrc, so lets exclude for now
|
||||
filename !== ".babelrc" &&
|
||||
filename !== ".babelignore" &&
|
||||
!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)
|
||||
) {
|
||||
const expected = opts.outFiles[filename];
|
||||
const actual = actualFiles[filename];
|
||||
try {
|
||||
if (
|
||||
// saveInFiles always creates an empty .babelrc, so lets exclude for now
|
||||
filename !== ".babelrc" &&
|
||||
filename !== ".babelignore" &&
|
||||
!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)
|
||||
) {
|
||||
const expected = opts.outFiles[filename];
|
||||
const actual = actualFiles[filename];
|
||||
|
||||
expect(expected).not.toBeUndefined();
|
||||
|
||||
if (expected) {
|
||||
expect(actual).toBe(expected);
|
||||
expect(actual).toBe(expected ?? "");
|
||||
}
|
||||
} catch (e) {
|
||||
e.message += "\n at " + filename;
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user