Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda