A person who holds stubbornly to a minority view, in defiance of the circumstances.
The title of the 1988 film Die Hard was chosen to signify both the 'hardness', that is, toughness, of the lead character and the difficulty that he and the bad guys had in killing each other. In choosing not to hyphenate 'die-hard', which is the currently accepted spelling, they reverted to the original meaning of the term - to 'die hard' was to die reluctantly, resisting to the end. This meaning of the term was recorded in 1703, in Psychologia: or, an Account of the Nature of the Rational Soul. The text argues the pros and cons of a condemned man's approach to death:
Against this Reason he [William Coward] urges the case of those that die hard, as they call it, at Tyburn who will therefore, according to him, out-brave the Terrors of the Lord.
Tyburn, near what is now Marble Arch, in London, was the principal location for public hangings in England until 1783. The 'drop' method of hanging wasn't then in use and the process was sometimes a prolonged affair. There are records showing that some of those who were about to be hanged opted to take the opposite course to the 'die hards' and paid people to hang onto their legs so that they died quickly. There's no evidence however for the commonly repeated notion that this is the derivation of the phrase 'pulling one's leg'.
The wider use of the term came into being in the following century. At the Battle of Albuhera in the Peninsula War in 1811, William Inglis, the commander of the British 57th Regiment of Foot, ordered all ranks "Die hard the 57th, die hard!", that is, to fight until the last. The regiment later became known as the Die-hards.
In the early 20th century, 'die-hard' was more usually used to describe a member of the political faction who were prepared to 'die in the last ditch' in their resistance to the Home Rule Bill of 1912. In 1922, the meaning took a step away from actual deaths, toward our present-day figurative meaning, when the members of the Conservative Party who followed the leadership of the Marquess of Salisbury named themselves 'The Die-hards'.
Like 'zigzag', 'meanwhile', and countless other terms which are coined as two words, later to become hyphenated and later still to merge into a single word, the 'diehard' spelling will probably come to be preferred before long.