Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
ng serve not putting scripts in correct subfolder

I have a build setup that works fine using ng build, but I can't get the same to work with ng serve.

I have two Angular applications using the same .angular-cli.json but being deployed to two different folders. It looks something like this:

"apps": [
    {
        "name": "app1",
        "root": "Client",
        "outDir": "wwwroot/app1",
        "index": "index-app1.html",
        "main": "app1.ts",
        "tsconfig": "tsconfig.app1.json",
        "prefix": "app1"
    },
    {
        "name": "app2",
        "root": "Client",
        "outDir": "wwwroot/app2",
        "index": "index-app2.html",
        "main": "app2.ts",
        "tsconfig": "tsconfig.app2.json",
        "prefix": "app2",
    }
],

I can run ng build --app=app1 or ng build --app=app2 and they are built into wwwroot/app1 and wwwroot/app2. I can then access the apps under http://localhost:4000/app1 and http://localhost:4000/app2.

But in my development environment I'd like to be able to use ng serve (for live reloading). The problem is that ng serve --app=app1 will create the js files directly under wwwroot (in a virtual directory), but index-app1.html look for them under http://localhost/app1/main.bundle.js for example.

I've tried to use different combination of --base-ref and --output-path but with no luck.

Does anyone know how to fix this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I never managed to find a better solution than running one app at a time using ng serve --base-href=/.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda