--copy-ignored flag added to CLI #10887
Conversation
|
Reviews at #10831 |
packages/babel-cli/src/babel/dir.js
Outdated
| if ( | ||
| !written && | ||
| ((!isCompilableExtension && cliOptions.copyFiles) || | ||
| cliOptions.includeIgnored) |
There was a problem hiding this comment.
I think we should throw in parseArgv when copyFiles: false, includeIgnored: true, otherwise we will have another flag that could copy non compilable files.
There was a problem hiding this comment.
🚲🏠 warning:
Should we call it --copy-ignored? 😝
There was a problem hiding this comment.
Changed to --copy-ignored
| @@ -0,0 +1,12 @@ | |||
| { | |||
| "args": [ | |||
There was a problem hiding this comment.
Can you add a test for --only?
babel src --out-dir lib --copy-files --only src/main/* --include-ignored
and a test when --include-ignored is not enabled (default of v7.8), so that we can make sure the old behaviour preserves.
There was a problem hiding this comment.
Is this still needed?
There was a problem hiding this comment.
|
I'm throwing error if |
| @@ -1 +0,0 @@ | |||
| a; | |||
There was a problem hiding this comment.
🤔Why is .foo.js not copied?
There was a problem hiding this comment.
we've --include-dotfile to Include dotfiles when compiling and copying non-compilable files.
https://github.com/rajasekarm/babel/blob/master/packages/babel-cli/src/babel/options.js#L148
There was a problem hiding this comment.
Yeah, it was copied before this PR. But now .foo.js has been removed from the out files, which means it is not copied.
There was a problem hiding this comment.
I got it, I'll check.
There was a problem hiding this comment.
I've that file in my branch, https://github.com/rajasekarm/babel/blob/master/packages/babel-cli/test/fixtures/babel/--copy-files%20--include-dotfiles%20with%20ignore/out-files/lib/foo/.foo.js
I dono why github shows this as removed.
There was a problem hiding this comment.
The linked one is your master branch, not the PR branch 😛
There was a problem hiding this comment.
Yeah, I'm check this.
There was a problem hiding this comment.
Found the root cause of this bug, I'm fixing it.
There was a problem hiding this comment.
.foo.js is inside src/foo and it is in ignored list. So it is not copied.
|
I've exposed pathToPattern function from @babel/core for the ignore file check. |
I have bad news for you 😛 |
|
Sure, I'll make the change. |
|
@nicolo-ribaudo Done 👍 |
(I need to review this PR again)
|
I was looking at the
If we make the |
|
@nicolo-ribaudo I made the requested change. Can you please check? |
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
The code now looks way cleaner!
Uh oh!
There was an error while loading. Please reload this page.