Skip to content

Commit

Permalink
basic documentation of outputDepcache usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mattquinlan440 committed Jul 10, 2024
1 parent 3ff9554 commit 550210e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ We recommend using a separate source file from your output file to allow for sou
orchard -i ./sourceFile.html -o ./outputFile.html
```

## Outputting depcache json format

If you're building an application using systemjs import maps, and utilizing the [depcache](https://github.com/guybedford/import-maps-extensions#depcache) format, you can output the json file to be used by the `orchard` cli tool with the following command:

```bash
orchard -o depcache.json --outputDepcache true
```

This outputs a json file that can be loaded by your solution, and that file will look something like:
```json
[
"https://unpkg.com/[email protected]/index.js",
"https://cdn.jsdelivr.net/npm/[email protected]/es.js"
]
```

### Usage Implications

In order to selectively serve modern code to modern browsers the script tags generated from the orchard utilize the `type="module"` attribute for es6+ builds, and es5 compatible code uses script tags with the `nomodule` and `defer` attributes.
Expand Down

0 comments on commit 550210e

Please sign in to comment.