Facebook and Google are both building more affordable housing in Silicon Valley

A rendering for part of Facebook's "Willow Campus" development in Menlo Park, California.

One day, Facebook employees will only have to cross the street to commute to the tech giant's Menlo Park headquarters.

In a blog post on Friday, Facebook announced plans to turn the 56-acre Menlo Science & Technology Park it bought in 2015 into a company town, dubbed the Willow Campus. Located across the street from the company's current campus, it will include a grocery store, pharmacy and shopping center.

"Working with the community, our goal for the Willow Campus is to create an integrated, mixed-use village that will provide much needed services, housing and transit solutions as well as office space," Facebook writes.

Of the 1,500 new housing units the company plans to build, 15 percent will be affordable, priced below the market rate. The village won't be comprised of only Facebook employees, either. Facebook will open up the units to the community at large, Business Insider reports.

Getty Images
Mark Zuckerberg, CEO of Facebook

Affordable housing is much needed in the Bay Area, where prices have reached such insane heights that some Facebook engineers reportedly asked Mark Zuckerberg for help paying rent and some Twitter employees earning $160,000 can feel like they're barely scraping by. Even some residents making six-figures can qualify as "low-income" and receive housing subsidies.

"These efforts complement our ongoing work to address the [housing] issue, including the Catalyst Housing Fund for affordable housing we established in partnership with community groups to fund affordable housing for our local area," Facebook writes.

It's worth noting, however, that prominent tech companies such as Facebook are in some ways responsible for the crisis they're now facing. As Quartz's Frederick Kuo reports, San Francisco's thriving technology industry has spurred economic growth, and the housing market can't keep up.

"The strength of recent job growth combined with policies that have traditionally limited housing development in the city and throughout the peninsula has proven to be a perfect recipe for an affordability crisis," Kuo writes. "In 2015 alone, the Bay Area added 64,000 in jobs; in the same year, only 5,000 new homes were built."

A rendering for Facebook's "Willow Campus" development in Menlo Park, California.

Another Silicon Valley heavyweight is attempting a solution as well. Google's parent company, Alphabet, is paying about $30 million to provide temporary, prefab housing for 300 of its employees.

According to The Wall Street Journal, Alphabet is making a significant investment in modular housing built and shipped in from elsewhere by the start-up Factory OS, because the current local offerings are so overpriced: "San Francisco rents have jumped by almost 50 percent since 2010, while home prices have increased 98 percent since the bottom of the market in 2009."

But rents for Alphabet's apartments are expected to be more moderate. Factory OS founder and CEO Rick Holliday tells the Journal that "a previous project that Holliday built using modular technology saved tenants $700 a month in rent because of reduced construction costs."

Brooks Kraft | Getty Images
Google employees arriving after bicycling to work at the Googleplex in Mountain View, CA.

The concept of a company town is nothing new. These insular communities first began cropping up during the Industrial Revolution, as corporations such as Hershey chocolate and Corning glass tried to "woo workers with fancy amenities," Smithsonian reports.

While some company towns encapsulated the picturesque "American Dream," others festered with poverty and abuse from bare-bones housing and harsh working conditions. In many textile, coal and steel towns, employees earned company credit in place of actual wages, which was only valid for use in high-priced company stores.

While modern-day examples of company towns can offer better conditions, it's still unclear if they're the answer to the housing crisis plaguing Silicon Valley.

Like this story? Like CNBC Make It on Facebook.

Don't miss: Here's how much home $2 million will get you across the U.S.