Multiple controls per .pcfproj - everything works but npx pcf-scripts start watch
#437
janis-veinbergs
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Someone once asked if multiple controls per .pcfproj is possible, staff said no: https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/Packaging-multiple-controls-in-single-project/td-p/460101
Maybe it is just an old answer and it still is unsupported, but it works well - pcf-start/pcf-scripts support and build multiple controls and they get added to solution OOTB.
There is just a single thing that is not convenient when developing: npm run start will open harness for first control in alphabetical order. There is no way to pass which control I want to "debug". Well, there actually is a way if one does this:
npx pcf-start --watch --codePath .\out\controls\DelimitedChoice\
That opens the correct harness. BUT it won't rebuild on changes - that
--watch
is only for browser-sync where it should reload whenever build happens, but build won't happen because no webpack is listening for changes. The only command that invokes watching files for rebuild ispcf-scripts start watch
but it opensbrowsersync
on itself and reserves the port.Anyway, all the machinery for building multiple controls is in place sans this single test harness thing. Would there be
--codePath
arg exposed to pcf-scripts too (which invokes pcf-start), there would be a solution. Ideally they would actually introduce-c, --control
parameter so one wouldn't have to specify any path and me would be happy 🙂The guilty line is within
pcf-scripts/tasks/startTask.js
:Ideally it would, along with validations, be:
That would enable:
npm run start watch -c ControlName
Or at least have pcf-start pass
--codePath
to pcf-scriptsP.S. having
npm run build watch
would also be useful for cases where I'm interested in fiddler-only-development (actually this is my case, I close that harness browser window anyway)Beta Was this translation helpful? Give feedback.
All reactions