用 angular-cli 構建

在 outDir 鍵的 angular-cli.json 中,你可以定義構建目錄;

這些是等價的

ng build --target=production --environment=prod
ng build --prod --env=prod
ng build --prod

這些也是如此

ng build --target=development --environment=dev
ng build --dev --e=dev
ng build --dev
ng build

構建時,你可以使用 –base-href your-url 選項修改 index.html 中的基本標記()。

在 index.html 中將基本標記 href 設定為/ myUrl /

ng build --base-href /myUrl/
ng build --bh /myUrl/