The logic is relatively easy, but the materials science needed to decide what to lithograph, using which materials, and in what order, is post-WWII, and probably couldn't have been invented much earlier.
It takes a lot of work to work out ideal doping factors and diffusion rates, estimate charge distributions across junctions, calculate propagation speeds, and eliminate leakage.
But more - the chemistry of semiconductor doping and deposition is often rather nasty, and it would have been a huge challenge to industrialise it before WWII.
1) the theoretical knowledge of how the devices worked, which enabled the creation of steps in the process that resulted in fully working devices
2) the ability do do each step repeatably and precisely and reliably.
Even on the basic science level, Maxwell published his seminal treatise on classical electromagnetism in 1873, and it wasn't until 1881 that Heaviside published them in the form we know them today and that sort-of made people understand them. Semiconductors were sort-of known already in the early 1800s, but it wasn't until the, say, first half of the 20th century when we really started to understand them with the development of solid state physics (both theoy and experimental methods such as x-ray diffraction etc.).
So yes, while some aspects of lithography could have been developed in the 1800s, I think there was quite a huge gap between that and a whole lot of other things needed.