I would avoid doing that because you are able to be much more creative and include more information in a thesis than papers. And a thesis only requires examiners in order to pass, but a PhD by publication involves many more opinions on your work and takes much longer :)