"Article I, Section 10, Clause 3: No State shall, without the Consent of Congress, lay any Duty of Tonnage, keep Troops, or Ships of War in time of Peace, enter into any Agreement or Compact with another State [emphases added], or with a foreign Power, or engage in War, unless actually invaded, or in such imminent Danger as will not admit of delay."
Just be clear, I dont think the idea is good. I think its bad.
But, to have a law that says they will assign electoral votes based on the popular vote winner is not a compact with other states. It does not say, If California goes blue, New Mexico will go blue. It is a difference WITH a distinction.