By including the effects of learning over time on both the production of components and their integration into complete products, we develop an engineering-based model of outsourcing. This model provides an alternative explanation for much of what other outsourcing theories predict, as well as making several new predictions. In particular, we show that outsourcing decisions can create a path-dependent outsourcing trap in which a firm experiences higher long-run costs after an immediate cost benefit. We also describe conditions under which outsourcing a small fraction of component production may dominate either complete insourcing or complete outsourcing. Finally, we show that, with discounting, there is a convex, curvilinear relationship between the optimal outsourcing fraction and the rate of technological change.