An extension cord is no substitute for permanent wiring. You do not need a subpanel for a single circuit to an outbuilding.