I have an existing sharepoint framework (SPFX) project. Now I want to create a custom search web part. So how can I add a new webaprt to existing solution

PS: I am very new to SPFx. TIA


Open the existing directory structure containing spfx in the command prompt.

After that simply call the yeoman generator again, fill up the details like webpart name, desc etc and it will automatically detect, handle and add the new webpart to the existing solution.

yo @microsoft/sharepoint

Run this in the command prompt.

For example below, I first created a webpart (helloworld) in E:\test-spfx folder. After that i ran the generator again and created another webpart hello2 in the same folder, it will add the webpart named hello2 in the same solution.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.