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
build: fix error when dev app is deployed (#23864)
The `index.html` of the dev app assumes that the `DEV_APP_VARIABLES` global variable will always be present, but that's not the case when it is deployed. This causes an error which prevents the Google Maps script from loading.
These changes add a null check, as well as some docs about the `variables.json`.
Copy file name to clipboardExpand all lines: DEV_ENVIRONMENT.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
# Developer guide: getting your environment set up
2
-
3
2
1. Make sure you have both `node` and `yarn` installed.
4
3
We recommend using `nvm` to manage your node versions.
5
4
2. angular/components uses Bazel which requires certain Bash and UNIX tools.
@@ -19,7 +18,6 @@ To bring up a local server, run `yarn dev-app`. This will automatically watch fo
19
18
and rebuild. The browser should refresh automatically when changes are made.
20
19
21
20
### Running tests
22
-
23
21
To run unit tests, run `yarn test <target>`. The `target` can be either a short name (e.g. `yarn test button`) or an explicit path `yarn test src/cdk/stepper`.
24
22
To run the e2e tests, run `yarn e2e`.
25
23
To run lint, run `yarn lint`.
@@ -67,7 +65,6 @@ at the file under `tools/public_api_guard/<target>.d.ts`.
67
65
68
66
69
67
### Disabling Git hooks
70
-
71
68
If your development workflow does not intend the commit message validation to run automatically
72
69
when commits are being created, or if you do not want to run the formatter upon `git commit`, you
73
70
can disable any installed Git hooks by setting `HUSKY=0` in your shell environment. e.g.
@@ -78,4 +75,11 @@ export HUSKY=0
78
75
79
76
# .bashrc
80
77
export HUSKY=0
81
-
```
78
+
```
79
+
80
+
### Injecting variables into the dev app
81
+
Variables can be injected into the dev app by creating the `src/dev-app/variables.json` file.
82
+
They'll be made available under the `window.DEV_APP_VARIABLES` object. The file isn't checked into
83
+
Git and it can be used to pass private configuration like API keys. Variables currently being used:
84
+
85
+
*`GOOGLE_MAPS_KEY` - Optional key for the Google Maps API.
0 commit comments