Skip to content

Commit dbf3f91

Browse files
Raja Sekarnicolo-ribaudo
authored andcommitted
Revert "Prevent ignored files in out dir (#10831)" (#10886)
This reverts commit 2b35909.
1 parent aa81407 commit dbf3f91

13 files changed

Lines changed: 4 additions & 33 deletions

File tree

packages/babel-cli/src/babel/dir.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,8 @@ export default async function({
8484

8585
async function handleFile(src: string, base: string): Promise<boolean> {
8686
const written = await write(src, base);
87-
const relative = path.relative(base, src);
88-
const isCompilableExtension = util.isCompilableExtension(
89-
relative,
90-
cliOptions.extensions,
91-
);
92-
if (
93-
!written &&
94-
((!isCompilableExtension && cliOptions.copyFiles) ||
95-
cliOptions.includeIgnored)
96-
) {
87+
88+
if (!written && cliOptions.copyFiles) {
9789
const filename = path.relative(base, src);
9890
const dest = getDest(filename, base);
9991
outputFileSync(dest, fs.readFileSync(src));

packages/babel-cli/src/babel/options.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,6 @@ commander.option(
161161
"Delete the out directory before compilation.",
162162
);
163163

164-
commander.option(
165-
"--include-ignored",
166-
"Include ignored files when copying non-compilable files.",
167-
);
168-
169164
commander.version(pkg.version + " (@babel/core " + version + ")");
170165
commander.usage("[options] <files ...>");
171166
// register an empty action handler so that commander.js can throw on
@@ -309,7 +304,6 @@ export default function parseArgv(args: Array<string>): CmdOptions | null {
309304
quiet: opts.quiet,
310305
deleteDirOnStart: opts.deleteDirOnStart,
311306
sourceMapTarget: opts.sourceMapTarget,
312-
includeIgnored: opts.includeIgnored,
313307
},
314308
};
315309
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a;

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js renamed to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js

File renamed without changes.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/index.js renamed to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js

File renamed without changes.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc

Whitespace-only changes.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md

Whitespace-only changes.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md

Whitespace-only changes.

packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)