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.
webaprt_a
and webpart_b
can I move webpart_b
into webpart_a
?
Commented
Jan 11, 2021 at 11:07
./src/webparts/webpart_a
), 2. Update the "manifest" (./config/config.json
) to include both webparts.