Bed Bath & Beyond laid off nearly 150 of its 65,000 employees this week, as more shoppers shift their spending online, a person familiar with the situation told CNBC.

The retailer, which has had seven consecutive quarters of declining same-store sales, has slowed down the pace of newer store openings and said it is evaluating existing leases. Meantime, it is investing in its online capabilities to help fend off stronger e-commerce rivals like Amazon.

"We were able to reassign many of those impacted by this realignment to other available store and corporate roles, but ultimately we had to reduce our headcount," a spokesperson for Bed Bath said in a statement. "This decision was a difficult but necessary step, and we are committed to treating all associates across the organization fairly and with respect."

As part of this week's reductions, a little less than 50 employees at its namesake Bed Bath & Beyond stores were laid off, the person said. Those employees were largely in the field support team that helps staff its stores. Other employees were reassigned to new positions as the company streamlines the roles and responsibilities of its store managers and support team.

A round of layoffs also hit the company's Christmas Tree Shops. Bed Bath acquired the discount home goods and decor chain in 2003. Fewer than 100 of its department and store managers were let go, the person said.

The layoffs come days after a trio of investors, Legion Partners Asset Management, Macellum Advisors GP and Ancora Advisors, on Tuesday confirmed their stake in the retailer and demanded a full turnover in the company's board. The investors lambasted Bed Bath for being slow to pivot to online shopping and allowing its costs to drift higher in recent years.

This week's layoffs at Bed Bath were planned before the investors' letter and are part of its ongoing turnaround, the person said.

In a memo to employees Tuesday, which was obtained by CNBC, Bed Bath CEO Steven Temares highlighted the company's planned and completed initiatives to usher in a turnaround. They include re-platforming the websites, focusing on data-driven personalized marketing, improved merchandise and a new, more efficient operating structure in its buying group.

The person requested anonymity because the information is confidential.