So this is slightly counter to what is being said but I finished a manuscript for Lacuna and it did me little good because I had quite a few plot holes by the end. I rewrote the first few chapters to fix some continuity issues and pacing problems, except then I had changed the beginning enough that the finished manuscript became a complex outline for general plot points that I sometimes pull scenes from.
To avoid running into this awful experience again, especially because my characters tend to bully me and distract from the plot points, what I do now is both.
I continued to write new chapters and keep up with light edits while posting them, but I took the first 10 chapters of the book and printed them. (Personal preference, you can make a copy of your digital file) As I began publishing my second part of the story, I took the first chunk and used a color coded highlighting system to look for 4 specific things: areas of my story that needed to be expanded on, reworded/revised, cut, and kept (usually one liner gems.) I did not change anything yet, just took notes.
This allowed a few magical things to occur:
Satisfied my urge to edit. It may not be visible changes people see yet, but that's okay with me because I have a hard copy of what needs to be fixed with notes I left myself on how to fix it.
Allowed me to revisit my work after some time away from it, look at it objectively, and determine what needs clarification at this point in the story.
Promoted continuity in my story, as I now keep the edits I need to make in mind moving forward.
In short? Do both.
Of course prioritize new chapters and finishing your story, but you can also go back and edit (in chunks!) I find it can actually helped refocus my writing and keep me on track, not distract me from the current story.