Closed tcharlat closed 8 years ago
Can you provide a repro case without grunt-browserify?
Yes and it confirms the issue :
> watchify app/scripts/react/app.jsx -o app/scripts/react/app.js -t [babelify --presets [es2015 react] ] -v
5159 bytes written to app/scripts/react/app.js (2.82 seconds)
5159 bytes written to app/scripts/react/app.js (0.05 seconds)
5159 bytes written to app/scripts/react/app.js (0.07 seconds)
etc.
PS:
As a matter of fact, I finally avoided the output in the source folder. It's not a good practice and didn't help (at all).
I was actually trying to hack my way out of useminPrepare, which has trouble targeting outside of the canonical source folder. And somehow ended up testing some things which led me to this bug.
I sanitized my source and output management and I don't target jsx anymore with usemin. Still hacky, but in the end it's fine and I shouldn't have had the current issue in the first place.
Except if you feel like watchify shouldn't behave this way, it's safe to close for me.
I still don't understand your issue. Can you show me a repo with a minimal case that has the problem?
@zertosh done, https://github.com/Kallikrein/watchify-issue
@Kallikrein, it works for me as expected using ./node_modules/.bin/watchify ./app.jsx -o ./app.js -t [ babelify --presets [ es2015 react ] ] -v
. I'm on a Mac, I'm guessing you're on windows (from your original post output)?
Yes, and I can't reproduce the issue on my server either.
I think etiher chokidar itself, or how watchify is passing arguments to it is the problem.
As I said, I don't have this bug anymore since I changed my folder structure, and shouldn't have had an output in the same folder as the sources in the first place anyway.
Unless you really want to fix this (and if chokidar is involved, you might not be able to), I would say it's safe to close this issue.
Yeah, this is too much of an edge case. Thanks for reporting!
And thanks to you for checking it out !
I have this issue with grunt-browserify, but I guess the watchify watcher is the cause of this issue.
Is fully functionnal.
This configuration re bundles infinitely, when 'app.js' is re-written, it triggers a new rebuild.
I guess the watcher can't discriminate 'app.jsx' and 'app.js'. I started digging into the source and it seems the watch event might be triggered by the chokidar dependency, in that case I guess the issue is irrelevant.
PS :