Police discovered cannabis plants capable of producing over £10,000 worth of the class B drug when they searched a house Batley, a court heard.
Leanne Foley was arrested after officers executed a search warrant at her home on Chinewood Avenue on March 15 this year.
Leeds Crown Court heard a total of 30 plants were found in an insulated tent in a bedroom.
Heating and lighting equipment were also discovered at the premises.
The electricity supply to the property had been bypassed.
Foley, 22, told officers that two men had knocked on the door of her home and threatened before ordering her to growing the plants.
The plants were examined and found to be capable of producing strong skunk cannabis with a street value of £10,800.
Foley pleaded guilty to permitting premises to be used for the production of cannabis and abstracting electricity.
A probation officer told the court that Foley had admitted becoming involved in the offence as she was a heavy cannabis and was in debt with her supplier. At the time of the offence she was smoking £40 worth of cannabis a day.
She felt intimidated and agreed to allow her home to be used to grow the illegal plants.
The court heard Foley had now moved away from the Batley and had taken step to control her cannabis habit.
Anastasis Tasou, for Foley, urged Recorder Anthony Kellbrick to take an exceptional course by imposing a community-based sentence so his client could continue to receive help for her drug habit.
Foley was made the subject of an 18-month community order, during which she must take part in a 15 activity programme.
She was also ordered to do 80 hours unpaid work.
Recorder Kellbrick told Foley: “Usually people go straight to prison for this sort of offence.”