Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
之前版本通过监听OnSourceLoaded来分别监听模块的文件夹,但这种方式处理不了文件夹被删除的情况。
因此如果生成JavaScript的策略是先删除老的再生成新的,就会产生报错,即使生成前后还是那些文件。
可以改成直接监听父目录,这个最简单的方式是外部直接传入脚本文件夹的地址,不过按照原先的思路也可以推算出来一个最顶层的父目录,然后直接监听这个父目录即可。
在文件产生变化时,就可以按照需要处理增删改了,目前尽量和之前保持一致,增改触发WatchedFileChanged,删除不触发。
这样应该就可以兼容直接覆盖文件和先删除后添加的方式了。