Might be a silly question, but i'm working on two controls at the moment.
How do i set the target of the "npm start" harness to load the second control?
:\PCF_Controls\_PCF\NumberButtonSelector>npm start > pcf-project@1.0.0 start C:\PCF_Controls\_PCF > pcf-scripts start Kicking off PCF start process... ..... Starting control harness... Mapping / to "C:\PCF_Controls\_PCF\node_modules\pcf-start" Serving "C:\PCF_Controls\_PCF\out\controls\Control1" at http://127.0.0.1:8181 ***I WANT IT TO LOAD Control2, not 1**** Ready for changes
I was having the same issue, and I wanted to be able to use the 'watch' option and without needing to build to 'out' to quickly see my changes.
I turns out, that the test harness simply runs the first control - sorted alphabetically on the containing folders.
So you can simply prefix the foldername containing the control that you want to execute with an underscore, and then run 'npm run watch'
/Leif
That script is designed to accept a --codePath argument which enables a user to point the harness to any directory that contains compiled control sources (ControlManifest.xml and bundle.js).
^ that's perfect. Thank you alchin.
Hi Andrew,
By default NPM start is designed to initiate the control defined in the current PCF project into the harness. If you have two separate control projects (PCF project), then you will need to CD into the root of the second pcf project and run npm start. All of the npm commands are project centric commands (build, clean, rebuild, start) and are designed to be applied to the current project only.
Under the hood, npm start calls the pcf-start script. That script is designed to accept a --codePath argument which enables a user to point the harness to any directory that contains compiled control sources (ControlManifest.xml and bundle.js).
For example, if I had my control code compiled into a folder called c:\out\controls\mycontrol, I could run:
npx pcf-start --codePath c:\out\controls\mycontrol
to launch the control from any output folder.
WarrenBelz
81
Most Valuable Professional
mmbr1606
53
Super User 2025 Season 1
Michael E. Gernaey
46
Super User 2025 Season 1