Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!