The contextual reading of the phrase makes it clear that at the very least it applies to Jews/Israelites:
יח לֹא-תִקֹּם וְלֹא-תִטֹּר אֶת-בְּנֵי עַמֶּךָ, וְאָהַבְתָּ לְרֵעֲךָ כָּמוֹךָ: אֲנִי, יְהוָה. 18
Thou shalt not take vengeance, nor bear any grudge against the children of thy people, but thou shalt love thy neighbour as thyself: I am the LORD.
The subject of the pasuk is רֵעֲךָ, your neighbor, and it seems that your neighbor is a subgroup that comes from בְּנֵי עַמֶּךָ, "the children of your people." So at the very least, you are commanded to love a fellow Israelite as yourself since your neighbor definitely comes from the children of your people. However, there is no limit given in this pasuk on who you should consider as your neighbor.
Most Rabbinical writings legislate this love as applying to Israelites, and this makes sense even to a modern reader. We as modern people usually legislate laws starting from the bare minimum, and we prioritize certain laws for citizens vs non citizens. Therefore it's logical to have the Rabbis say that this commandment at the very least applies to only Israelites as the context implies.
However, some Rabbis go an extra step further and forbid expanding the concept of who your neighbor is to include non-Jews. It doesn't seem clear to me that the Torah ever forbids expanding the concept of who your neighbor is, and the Tanakh as a whole seems to only get more overtly inclusive toward non-Jews in the later books. Furthermore, I believe certain theological problems arise when you attempt limit the idea of your neighbor as only applying to your fellow Jew.
All of this boils down to how we define the word רֵעֲךָ. But for those who would say that the word רֵעֲךָ can only apply to Jews, and therefore you cannot expand this to include non Jews, then I would answer this argument has some terrible implications. This would mean that I am fully allowed to bear false witness against non Jews, covet their wives, and covet their homes and property.
The Ten Commandments from Devarim/Deuteronomy 5
.לֹא תִרְצָח, וְלֹא תִנְאָף; וְלֹא תִגְנֹב, וְלֹא-תַעֲנֶה
בְרֵעֲךָ עֵד שָׁוְא וְלֹא תַחְמֹד, אֵשֶׁת רֵעֶךָ; וְלֹא
תִתְאַוֶּה בֵּית רֵעֶךָ, שָׂדֵהוּ וְעַבְדּוֹ וַאֲמָתוֹ שׁוֹרוֹ
וַחֲמֹרוֹ, וְכֹל, אֲשֶׁר לְרֵעֶךָ
16 Thou shalt not murder. Neither shalt thou commit adultery. Neither
shalt thou steal. Neither shalt thou bear false witness against thy
neighbour. 17 Neither shalt thou covet thy neighbour's wife; neither shalt thou desire thy neighbour's house, his field, or his
man-servant, or his maid-servant, his ox, or his ass, or any thing
that is thy neighbour's.
Maybe there are those who would say that I could do all these terrible things to non Jews since they aren't "my neighbor." But I'm a person who cannot abide in believing in an unethical religion, therefore I cannot in good conscience say that I am completely allowed to bear false witness against and sleep with the wive's of non Jews while coveting all of their property because they aren't "my neighbor."
And I have my suspicions that those who would limit the concept of who your neighbor is only do so as a polemic against Jesus/Christianity who taught that your neighbor wasn't limited to fellow Jews. Jesus not only expanded who the concept of your neighbor is, but Christianity as a whole has continued to expand "your neighbor" to include everyone based on the following parable found in the Christian scriptures:
The Parable of the Good Samaritan from Luke 10
25 On one occasion an expert in the Torah stood up to test Jesus.
“Teacher,” he asked, “what must I do to inherit eternal life?”
26 “What is written in the Torah?” he [Jesus] replied. “How do you read it?”
27 He answered, “‘Love the Lord your God with all your heart and with
all your soul and with all your strength and with all your mind’
and, ‘Love your neighbor as yourself.’”
28 “You have answered correctly,” Jesus replied. “Do this and you will
29 But he wanted to justify himself, so he asked Jesus, “And who is my
30 In reply Jesus said: “A man was going down from Jerusalem to
Jericho, when he was attacked by robbers. They stripped him of his
clothes, beat him and went away, leaving him half dead. 31 A priest
happened to be going down the same road, and when he saw the man, he
passed by on the other side [to avoid becoming ritually impure on account of the man who might die]. 32 So too, a Levite, when he came to the
place and saw him, passed by on the other side [for the same reason]. 33 But a Samaritan, as
he traveled, came where the man was; and when he saw him, he took pity
on him. 34 He went to him and bandaged his wounds, pouring on oil and
wine. Then he put the man on his own donkey, brought him to an inn and
took care of him. 35 The next day he took out two denarii[e] and gave
them to the innkeeper. ‘Look after him,’ he said, ‘and when I return,
I will reimburse you for any extra expense you may have.’
36 “Which of these three do you think was a neighbor to the man who
fell into the hands of robbers?”
37 The expert in the law replied, “The one who had mercy on him.”
Jesus told him, “Go and do likewise.”
Clearly Jesus expanded this love to Samaritans (whom normative Jews classify as non Jews and potentially enemies) because of the Samaritan's love and mercy for the man in this story. The message being: your neighbor is anyone that has mercy on you. To me, this is a lesson I have seen reflected in my life, as some of the greatest mercy I have ever received has come from non Jews. Thus I feel compelled to say I find value in the teaching of Jesus, especially when compared to some of the more restrictive teachings about who your neighbor is or isn't. I would have loved it if I found as good a teaching from my tradition instead of having to quote Jesus, but I also believe that you should accept the truth regardless of the source.
So while I can't say that you are required to love non-Jews as you love yourself, I find it morally questionable to limit the idea of your neighbor to only being your fellow Jew.