If AI advances to the point where large swathes of workers even amongst developers are put out of work, then worrying about your own job is a little beside the point. Will be a large and apparent social issue then. I am still skeptical this will happen but if you had asked me 3 years ago could AI do what it is capable of already by today I would have said with 100% certainty there is not chance so I'm holding back my opinion at this point.
However, as an answer to your question: If you're looking for a skill to learn once in a short time and apply that for a decade; then web front-end coding is among the worst options.
Perhaps I’m just being shortsighted here. I can sort of see how AI tech would evolve to achieve this. You would need an AI assistant able to persist the entire context of your application across months/years in a stable way to act as your ongoing “web developer“. Will that be feasible?