惟 is a classical/literary variant of 唯 (wéi). Both mean 'only'. 惟 appears frequently in formal writing, classical texts, and set expressions. In modern usage, 唯 is more common.
grammar
惟 can also function as a conjunction meaning 'but/however' in classical Chinese, similar to 但 in modern usage.