cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndrewLyMVP
Level 8

PCF Harness (NPM Start), how do i target another control to start?

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
1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft alchin
Microsoft

Re: PCF Harness (NPM Start), how do i target another control to start?

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.

View solution in original post

2 REPLIES 2
Microsoft alchin
Microsoft

Re: PCF Harness (NPM Start), how do i target another control to start?

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.

View solution in original post

Highlighted
AndrewLyMVP
Level 8

Re: PCF Harness (NPM Start), how do i target another control to start?

 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.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Users online (9,912)