When restarted, compiler would rewrite cljs_deps and remove all npm modules dependency. Problem only appears when rebuilding, not from clean compilation.
Workaround: Do a clean build every time compiler has to be restarted.
Minimal example: https://github.com/poernahi/cljsbuild_wrongdeps
Steps to reproduce using above example:
1. Copy/symlink clojurescript uberjar into project root as cljs.jar
2. make clean && make && wc -l out/cljs_deps.js # Should return 186 lines
3. touch src/cljsbuild_wrongdeps/core.cljs && make && wc -l out/cljs_deps.js # Now returns only 4 lines!!
I think this is related to CLJS-2339. I narrowed down to this line
When a new compiler instance is run, the cache in ::transitive-dep-set is empty and index-node-modules return nil.