dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
2.99k stars 283 forks source link

Better package manager and bundler support for npm apps #3990

Closed pdevito3 closed 2 weeks ago

pdevito3 commented 2 weeks ago

I see that we currently have the 'addNpmApp()' option, but it's fairly restrictive in what it exposes (from what I can tell at least). Apologies if I'm missing a way to do this with the existing implementation.

The two main things I notice are:

  1. Lack of support for bundlers other than webpack
  2. Lack of support for package managers other than NPM (yarn, pnpm, bun) nevermind I realized that npm build works just fine for those 🤦‍♂️

The bundler part is the most limiting for me as webpack is dated and painful. Vite is becoming quite standard so id think we'd at least want support for that.

I'd love to try getting a react app and a .net bff working with aspire if we can figure out something here!

Happy to brainstorm an api or work with some examples! But wanted to gauge openness first.

timheuer commented 2 weeks ago

@pdevito3 Have you checked out the samples? The Vue one uses Vite: https://github.com/dotnet/aspire-samples/tree/main/samples/AspireWithJavaScript/AspireJavaScript.Vue

pdevito3 commented 2 weeks ago

I hadn't checked the vue one, just the react one.

Would be great if I'm just missing something but it looked like under the hood it was using node_env for env vars which vite apps wouldn't like to my knowledge.

I did just see #1898 too which seems to reflect that issue but David threw out a workaround.

I'd probably classify this as a dupe of that. Sorry I missed it on my first pass