Heat oil in a saucepan over medium-high. Add onion and cook until softened and fragrant, about 5 minutes.
Whisk in all remaining ingredients except the liquid smoke.
Bring to a boil, then reduce heat and simmer until thickened and reduced to about 2 cups, roughly 30 minutes.
Stir in liquid smoke if using. Let cool, then refrigerate in an airtight container for up to 2 weeks.