Support for 'built' web resources
See original GitHub issueIt 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/
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:7 (1 by maintainers)
Love the idea! One way of getting around the ever changing js world is to provide a run, build, test and so on definition in the package json, but allow us to change it. Then you know the pac cli will call npx run build and we can add whatever we want to it if we adapt the setup
I think one of the biggest hurdles this faces, is the ever changing JS/TS world. How quickly would the setup project fall out of date? Second issue would be how do you pick the default settings/libraries. There are just Soo many options.