The formation of subdwarf B (sdB) stars is not well understood within the current framework of stellar single and binary evolution. In this study, we focus on the formation and evolution of the pulsating sdB star in the very short-period eclipsing binary PG1336-018. We aim at refining the formation scenario of this unique system, so that it can be confronted with observations. We probe the stellar structure of the progenitors of sdB stars in short-period binaries using detailed stellar evolution calculations. Applying this to PG1336-018 we reconstruct the common-envelope phase during which the sdB star was formed. The results are interpreted in terms of the standard common-envelope formalism (the alpha-formalism) based on the energy equation, and an alternative description (the gamma-formalism) using the angular momentum equation. We find that if the common-envelope evolution is described by the alpha-formalism, the sdB progenitor most likely experienced a helium flash. We then expect the sdB mass to be between 0.39 and 0.48 Msun, and the sdB progenitor initial mass to be below ~2 Msun. However, the results for the gamma-formalism are less restrictive, and a broader sdB mass range (0.3 - 0.8 Msun) is possible in this case. Future seismic mass determination will give strong constraints on the formation of PG1336-018 and, in particular, on the CE phase.