Moving home, remortgaging to buy the property and looking to pay off debt. Will the debt be used for affordability checks, if I'm paying it off with the mortgage?

As the title says really. I can borrow much less if I include my debt in a mortgage application to move home, whereas if I reduce my deposit (equity from home) by the amount I would need to clear debt then I have a lot of headroom in affordability and be able to upsize into a more suitable home.TIA.