This reverts commit 2b3590929b4eb955b0e8b287f9749b5af66cc1a0.
This commit is contained in:
parent
aa814073b7
commit
dbf3f91f1e
@ -84,16 +84,8 @@ export default async function({
|
||||
|
||||
async function handleFile(src: string, base: string): Promise<boolean> {
|
||||
const written = await write(src, base);
|
||||
const relative = path.relative(base, src);
|
||||
const isCompilableExtension = util.isCompilableExtension(
|
||||
relative,
|
||||
cliOptions.extensions,
|
||||
);
|
||||
if (
|
||||
!written &&
|
||||
((!isCompilableExtension && cliOptions.copyFiles) ||
|
||||
cliOptions.includeIgnored)
|
||||
) {
|
||||
|
||||
if (!written && cliOptions.copyFiles) {
|
||||
const filename = path.relative(base, src);
|
||||
const dest = getDest(filename, base);
|
||||
outputFileSync(dest, fs.readFileSync(src));
|
||||
|
||||
@ -161,11 +161,6 @@ commander.option(
|
||||
"Delete the out directory before compilation.",
|
||||
);
|
||||
|
||||
commander.option(
|
||||
"--include-ignored",
|
||||
"Include ignored files when copying non-compilable files.",
|
||||
);
|
||||
|
||||
commander.version(pkg.version + " (@babel/core " + version + ")");
|
||||
commander.usage("[options] <files ...>");
|
||||
// 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 {
|
||||
quiet: opts.quiet,
|
||||
deleteDirOnStart: opts.deleteDirOnStart,
|
||||
sourceMapTarget: opts.sourceMapTarget,
|
||||
includeIgnored: opts.includeIgnored,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
a;
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
"args": [
|
||||
"src",
|
||||
"--out-dir",
|
||||
"lib",
|
||||
"--copy-files",
|
||||
"--ignore",
|
||||
"src/foo/*",
|
||||
"--include-ignored",
|
||||
"--verbose"
|
||||
]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
index;
|
||||
@ -1,2 +0,0 @@
|
||||
src/index.js -> lib/index.js
|
||||
Successfully compiled 1 file with Babel.
|
||||
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;
|
||||
Loading…
x
Reference in New Issue
Block a user