We've discussed this before a number of times. If it is charging the battery that is in use to drive the bike, it will be a motor vehicle in law and not an e-bike.
Even if it is charging another battery disconnected from the bike, it will still breach some other laws concerning roads use, but it will probably not be thought to be a motor vehicle. It could still be subject to motor vehicle pollution laws though, since those are environmental issues.