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

babel-cli in --watch mode doesn't delete output file when source file is deleted #9293

henbjo opened this Issue Jan 7, 2019 · 1 comment


None yet
2 participants
Copy link

henbjo commented Jan 7, 2019

Bug Report

Current Behavior
When I run babel-cli with the --watch flag, files that I delete from my src directory still remain present in the output directory.

Expected behavior/code
Because babel-cli watches my src directory, I would expect it to detect deleted files and delete the corresponding output file as well.

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

  "presets": [
        "targets": "> 0.25%, not dead",
        "modules": false


  • Babel version: v7.0.0
  • Node/yarn version: Node 10.14.1/yarn 1.12.3
  • OS: macOS 10.14.1
  • Monorepo: no
  • How you are using Babel: cli

Possible Solution
Listen to unlink events when watching the source tree and delete the corresponding output files.

Additional context
Issue 5636 already discusses this problem, and this comment suggests it should be the default behavior.


This comment has been minimized.

Copy link

babel-bot commented Jan 7, 2019

Hey @henbjo! 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
that typically always has someone willing to help. You can sign-up here
for an invite.

henbjo added a commit to henbjo/babel that referenced this issue Jan 8, 2019

henbjo added a commit to henbjo/babel that referenced this issue Jan 8, 2019

babel-cli in --watch mode detects deleted directories within source d…
…irectory and deletes corresponding directories in output directory (babel#9293)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment