cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

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
Highlighted
Microsoft
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
Highlighted
Microsoft
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

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (11,122)