You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,20 @@ You can also add your own env files other than `dev` and `prod` by creating a
141
141
`src/app/environments/environment.{NAME}.ts` and use them by using the `--env=NAME`
142
142
flag on the build/serve commands.
143
143
144
+
### Base tag handling in index.html
145
+
146
+
You can modify base tag (`<base href="/">`) in your index.html by using `--base-href your-url` option. It's useful when building or serving for different environments.
147
+
148
+
```bash
149
+
# Sets base tag href to /myUrl/ in your index.html
150
+
ng build --base-href /myUrl/
151
+
ng serve --base-href /myUrl/
152
+
153
+
# Does nothing
154
+
ng build --base-href
155
+
ng serve --base-href
156
+
```
157
+
144
158
### Bundling
145
159
146
160
Builds created with the `-prod` flag via `ng build -prod` or `ng serve -prod` bundle
0 commit comments