Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need --delete-dir-on-start or --delete-file-when-src-file-deleted option for babel --watch flag #5636

Closed
landyu opened this issue Apr 15, 2017 · 5 comments · Fixed by #6187 · May be fixed by #9124
Closed

Need --delete-dir-on-start or --delete-file-when-src-file-deleted option for babel --watch flag #5636

landyu opened this issue Apr 15, 2017 · 5 comments · Fixed by #6187 · May be fixed by #9124
Labels
claimed good first issue Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@landyu
Copy link

landyu commented Apr 15, 2017

Babel Configuration (.babelrc, package.json, cli command)

{
  "presets": [
    "flow",
    ["env", {
      "targets": {
        "node": true
      }
    }]
  ],
  "retainLines": true
}

Watch Script

"watchToBuild": "babel app_flow --watch --out-dir app"

Expected Behavior

when i delete some files or directories in app_flow directory, i hope these related files or directories would be deleted at same time. But actually these related files and directories still remain in the output directory app!

Current Behavior

Your Environment

software version(s)
Babel 6.24.1
node 5.12.0
npm 3.8.6
Operating System MacOS
@babel-bot
Copy link
Collaborator

Hey @landyu! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@landyu landyu closed this as completed Apr 16, 2017
@landyu landyu reopened this Apr 16, 2017
@landyu
Copy link
Author

landyu commented Apr 16, 2017

if babel add --delete-dir-on-start or --delete-file-when-src-file-deleted option for babel --watch flag, will make the workflow better.

purpose: to make the source directory has the same files and directories as the output directory.
--delete-dir-on-start : when we restart the babel script, babel delete the output directory first.
--delete-file-when-src-file-deleted: start babel build script with --watch flag, babel could delete the output files or directories which were deleted from the source directories.

@landyu landyu changed the title --watch option could not monitor delete action Need --delete-dir-on-start or --delete-file-when-src-file-deleted option for babel --watch flag Apr 16, 2017
@loganfsmyth
Copy link
Member

I think my preference would be a --delete-dir-on-start that is allowed when --out-dir is used, and would ensure that the directory is empty when compilation starts.

Open to suggestions for alternate names for that option since I'm not totally in love with the verbosity of that one.

--delete-file-when-src-file-deleted seems like it doesn't need an option. If we end up implementing it, having it be the default behavior seems fine to me.

@keshcode
Copy link

i would like to work on this issue

@xtuc
Copy link
Member

xtuc commented Apr 19, 2017

@keshcode good news 👍. You can join our Slack if you need some help.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
claimed good first issue Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
6 participants