Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(docs) Update an outdated FAQ about importmaps #602

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/main/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ git checkout package.json
yarn
```

## Refreshing importmap
### Using a custom importmap

The static importmap file used by `openmrs develop` is manually updated and therefore often out of date containing old versions of the frontend modules. You can submit a PR to update [that file](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/shell/esm-app-shell/src/assets/importmap.json), or you can use an import map from the internet like so:
By default, when you run `yarn start`, the command will use the importmap from dev3, that is, https://dev3.openmrs.org/openmrs/spa/importmap.json. This is the default importmap for the reference application and generally what you will want to use. However, in some situations, you may want to us a custom importmap, such as a distribution-specific importmap. In this case, you can use the `--importmap` argument to the `yarn start` command to point to any importmap you like:

```sh
yarn start --importmap "https://spa-modules.nyc3.digitaloceanspaces.com/import-map.json"
yarn start --importmap "https://dev3.openmrs.org/openmrs/spa/import-map.json"
```


### Clearing out the browser cache

By default the server [tells your browser](https://github.com/openmrs/openmrs-contrib-ansible-docker-compose/blob/c36115ca22b8fb842f8cf0ff745d1d35a4567912/files/emr-3-dev/proxy.conf#L97) to cache JavaScript files for 30 days. You can [bypass your browser's cache](https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache) when refreshing the page. If you want to keep the cache disabled while you are developing, open your browser's developer tools, go to the "Network" tab, and check "Disable Cache." The cache will only be disabled while the developer tools are open, and only for the page that they are attached to.
Expand Down