Angular-cli build with base-href also returns program folder when using git bash

I am trying to create an angular project using angular-cli in the MINGW64 docker on a Windows 7 Pro computer.

In git bash, the command I use is:

ng build --prod --base-href /appcontext/

I am trying to change the current current base tag with attribute href="/"tohref="/appcontext/"

Instead, I end up with a base tag with href="C:/Program Files/Git/appcontext/".

Any idea?

+4
source share
2 answers

, , MINGW ( ng-serve --base-href GIT Bash Windows 10). , Powershell GIT Bash - base-href .

+5

TL;DR: / /.


:

git - bash Windows. git - bash

ng build --prod --base-href /directory/

( " " ).

( , ):

:

ng build --prod --base-href //directory/

git - bash, URL-, , , , hostname, , URL-

http://hostname/directory/

http://directory/

, :

ng build --prod --base-href //hostname/directory/

, . , .

( , ):

"": HTML. CLI href="..." (double-) ( , IMHO). /, :

ng build --prod --base-href /directory/

, :

<base href="&#x2f;directory/">

"" ( HTML/XML)

<base href="/directory/">

, Angular "" CLI, ,

<base href="&amp;#x2f;directory/">

URL-

http://hostname/&#x2f;directory/
+1

Source: https://habr.com/ru/post/1670037/


All Articles