The word weeaboo first appears as a nonsense word in a 2005 Perry Bible Fellowship webcomic: https://pbfcomics.com/comics/weeaboo/

It gained its current meaning later that year. On anonymous web forum 4chan, “wapanese” was then a common slur used against white people who enjoyed anime and manga. As an intervention, moderators added a word filter that replaced all instances of it with a ridiculous word that didn’t mean anything, “weeaboo”. This did not dramatically reduce the frequency of its usage, but it did end up changing the word that was used.

Weeaboo continued to be a common enough word on the internet that a short form, weeb, became standard within a few more years. It has mostly lost its original pejorative sense.