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
Browserify should not create empty output files on error #899
Comments
+1, this behavior is quite annoying. |
+1, as a workaround, those who use GNU make, just add .DELETE_ON_ERROR as a target https://www.gnu.org/software/make/manual/html_node/Special-Targets.html |
…ist previously
I'm offering a PR for this |
…ecause of Node 0.8
Looks like the proposed fix for this wasn't a great solution. Seems to me the proper way to handle this would be:
This is ± how e.g. Cocoa does atomic file overwrites [in that case the temporary and target files need to be on same volume, doesn't seem quite as important here just to fix this issue so long as you avoid/handle the |
Write browserify command output to a temporary file, overwriting the target file atomically upon success (and simply cleaning up the tempfile on error). This has two benefits: * user won't be left with an empty file if compilation fails (which can break toolchains that rely on destination files/timestamps to indicate build status, Make or django-pipeline for just two examples) * output file can never end up in a half-written state during even a successful compilation
(Alternate pull request submitted.) |
When an error occurs, Browserify 5.11.2 creates an empty output file. This should not happen, as it messes up
make
-based workflows.The text was updated successfully, but these errors were encountered: