DEV Community

Cover image for Modern Power App development takes a lot of... SPACE.
Riccardo Gregori
Riccardo Gregori

Posted on

Modern Power App development takes a lot of... SPACE.

🧠 The Paradigm Shift: Why We Don’t Argue UI Anymore

There was a time (you remember it) when any client request that drifted outside the "blessed" Power Apps patterns triggered a long conversation about platform constraints. We tried to reshape requirements, push standard controls, and hope stakeholders would accept a slightly clunky interaction with the UI in the name of long-term maintainability.

That era is over.

With AI-assisted development (hello my dear friend, GitHub Copilot), it’s now faster and safer to build small, targeted customizationsβ€”PCFs or React WebResourcesβ€”than to litigate UX.

You can ship exactly what the client envisions, document it properly, and make it maintainable long-term. The payoff is huge: better UX β†’ higher adoption β†’ stronger platform stickiness. In other words, great UI is not a "nice-to-have"β€”it’s a retention strategy.

When you replace β€œdiscuss why we can’t” with β€œdeliver what delights,” you:

  • Earn trust faster
  • Accelerate sign-off
  • Anchor the customer to the platform with experiences they love

But there’s a catch…

🧱 The Problem: A Dozen PCFs/WebResources = Disk Space Meltdown

React-based PCFs and WebResources lean on Node’s ecosystem. And Node’s ecosystem leans on… node_modulesβ€”the folder that eats hard drives for breakfast.

Every project carries its own dependency tree. Multiply that across 8, 12, 20 PCFs/WebResources… and your laptop screams. It’s common to see hundreds of thousands of files and tens (or hundreds) of GB consumed across projects.

Good news: there’s a clean, robust solution that many Power Platform devs underuse:

🧩 The Hidden Gem: NPM Workspaces

NPM Workspaces let you manage multiple packages/projects (PCFs/WebResources) under one repository, sharing a single top-level node_modules whenever possible. This dramatically reduces duplication and makes dependency management more predictable and CI-friendly.

Official docs: NPM Workspaces

What you get:

  • βœ… One central node_modules (plus small per-package shims when needed)
  • βœ… Shared tooling (TypeScript config, lint rules, build scripts)
  • βœ… Shared local packages (@types/xrm, @fluentui/react-components) used across PCFs/WRs via workspace:
  • βœ… Unified scripts (build, test, lint) across all packages
  • βœ… Faster CI with a single dependency tree and cache

πŸ€” How Does It Works?

It's quite straightforward. All you need is to define a package.json and a package-lock.json files at the root of your project folder, just above the folders containing PCFs and WebResources. This will make your project folder a monorepo.

πŸ“‚ my-monorepo/
β”œβ”€ πŸ“„ package.json         <-- workspace root
β”œβ”€ πŸ“„ package-lock.json
β”‚
β”œβ”€ πŸ“‚ Pcf/
β”‚  β”œβ”€ πŸ“‚ pcf1/
β”‚  β”‚  β”œβ”€ πŸ“„ package.json
β”‚  β”‚  └─ ...
β”‚  └─ πŸ“‚ pcf2/
β”‚     β”œβ”€ πŸ“„ package.json
β”‚     └─ ...
β”‚
└─ πŸ“‚ WebResources/
   β”œβ”€ πŸ“‚ webresource1/
   β”‚  β”œβ”€ πŸ“„ package.json
   β”‚  └─ ...
   └─ πŸ“‚ webresource2/
      β”œβ”€ πŸ“„ package.json
      └─ ...
Enter fullscreen mode Exit fullscreen mode

It is important that the root package.json file contains the following:

{
  "name": "my-monorepo",
  "private": true,
  "workspaces": [
    "Pcf/*",
    "WebResources/*",
  ]
}
Enter fullscreen mode Exit fullscreen mode

You can do it manually, or via:

cd my-monorepo
npm init -y

npm pkg set private=true
npm pkg set workspaces[0]="Pcf/*"
npm pkg set workspaces[1]="WebResources/*"
Enter fullscreen mode Exit fullscreen mode

Then you can create your PCFs into the PCF and WebResources folder as usual... Just a tip: remember that the value of the name node of the package.json files under each of your PCFs/WRs must be unique, otherwise you'll get an error while running npm <whatever>.

When you'll run

npm install
Enter fullscreen mode Exit fullscreen mode

All dependencies will be installed in a single, above all, node_modules folder created just under the my-monorepo folder.

NOTE: If two packages need different versions of the same dep, npm may place some deps locally. That’s fine; you’ll still save tons of space overall.

πŸ—‚οΈ A Practical Folder Structure for Power Platform Projects

Here’s a realistic example of the output folder you'll get, on a standard Power App project:

πŸ“‚ project-folder
β”œβ”€ πŸ“„ .gitignore
β”œβ”€ πŸ“‚ src
β”‚  β”œβ”€ πŸ“„ package.json
β”‚  β”œβ”€ πŸ“„ package-lock.json
β”‚  β”œβ”€ πŸ“‚ node_modules
β”‚  β”œβ”€ πŸ“‚ Pcf
β”‚  β”‚  β”œβ”€ πŸ“‚ NumericInputControl
β”‚  β”‚  β”‚  β”œβ”€ πŸ“„ package.json
β”‚  β”‚  β”‚  β”œβ”€ πŸ“„ package-lock.json
β”‚  β”‚  β”‚  └─ ...
β”‚  β”‚  β”œβ”€ πŸ“‚ PurchaseOrderGrid
β”‚  β”‚  β”‚  β”œβ”€ πŸ“„ package.json
β”‚  β”‚  β”‚  β”œβ”€ πŸ“„ package-lock.json
β”‚  β”‚  β”‚  └─ ...
β”‚  β”‚  └─ πŸ“‚ CustomTreeView
β”‚  β”‚     β”œβ”€ πŸ“„ package.json
β”‚  β”‚     β”œβ”€ πŸ“„ package-lock.json
β”‚  β”‚     └─ ...
β”‚  └─ πŸ“‚ WebResources
β”‚     β”œβ”€ πŸ“‚ HomePage
β”‚     β”‚  β”œβ”€ πŸ“„ package.json
β”‚     β”‚  β”œβ”€ πŸ“„ package-lock.json
β”‚     β”‚  └─ ...
β”‚     └─ πŸ“‚ ControlDashboard
β”‚        β”œβ”€ πŸ“„ package.json
β”‚        β”œβ”€ πŸ“„ package-lock.json
β”‚        └─ ...
└─ πŸ“‚ test
   └─ ... # other stuff
Enter fullscreen mode Exit fullscreen mode

πŸ“‰ How Much Space Do You Actually Save?

In Power Platform solutions with 8–20 React packages, we’ve seen:

  • 60–80% reduction in duplicated dependency files
  • Build times drop (less overall I/O and fewer cold installs)

Your mileage varies with library choices, but the direction is always the same: less bloat, more flow.

πŸͺ„ Conclusions

AI copilot tools make building custom, crisp UX easy. NPM Workspaces make maintaining many customizations sane. Put them together and you’ve got a Power Platform development lifecycle that’s fast, clean, andβ€”dare I sayβ€”fun.

Give it a try, and let me know in the comments what you think about it!

Top comments (0)