How do I get "--base-href" to not expand to an absolute path when building using npm?

Discussão em 'Angular' iniciado por Dave, Junho 3, 2025.

  1. Dave

    Dave Guest

    I'm using Angular 14 and NPM 8. I have this command for building my artifact ...

    npm run build -- --source-map --base-href=/my-app/ --output-path=dist/my-app/


    The problem is, when my dist/my-app/index.html file is generated it contains the full path to my local machine

    <!DOCTYPE html><html lang="en"><head>
    <meta charset="utf-8">
    <title>MyApp</title>
    <base href="C:/Program Files/Git/my-app/">


    How do I run my build command such that my base href is only what is included after my "base-href" flag?

    Continue reading...

Compartilhe esta Página