-
Notifications
You must be signed in to change notification settings - Fork 55
Description
It would be great if the the Power Platform CLI could be enhanced for 'built' webresources, e.g. transpiled TypeScript, minified JavaScript, reduced image resources, resx files, etc. Perhaps something similar to pac solution add-resource-reference, along with a new project type pac resource init --kind TypeScript to initialise a TypeScript webresource project.
In my test repo (https://github.com/filcole/pacbuild) I've experimented with building a PCF, plugin, solution and package deployer package using just the pac tooling, which works great. A large remaining gap is webresources, since there is often there is a need to transpile webresources and include them in a solution using a mapping xml file.
Additionally often there is a need to use multiple npm packages, especially with TypeScript builds, e.g. prettier, ESLint, webpack/rollup/parcel, @microsoft/eslint-plugin-power-apps, @types/xrm, etc. Perhaps even sometimes running unit tests with Jest. It would be good if any setup could also include recommendations/guidance on restoring npm packages (npm install or npm ci) as part of a build.
One concern with the pac solution add-reference style, is how one might incrementally build a package. Currently in a hosted github/devops pipeline the MSBuild style will build everything on every build without the ability to use pipeline caching or pipeline artefacts to reduce the build duration. Is this a limitation of MSBuild, or are there techniques to use here?
I think this may be a common issue, since there are many blogs/forums/tweets asking how one might do this:
https://twitter.com/EffEyeEll/status/1567929125310009347
https://learn.develop1.net/courses/building-javascript-web-resources-using-typescript
https://benediktbergmann.eu/2020/12/04/setting-up-a-typescript-project-for-dataverse/
https://xrm.al/blog/typescript-dataverse
https://www.youtube.com/watch?v=VsKsfNkzL50
https://dev.to/oliverflint/d365-typescript-web-resources-part-1-basics-10lg
https://www.xrm.dev/typescript-xrmdefinitelytyped/