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

README: update paths documentation #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,21 @@ The plugin takes an options object with the following properties:
| Property | Type | Optional | Description |
| -------- | ---- | -------- | ----------- |
| entries | `string[]` | No | The entry scripts to include in the generated HTML file |
| paths | `string[]` or `{ path: string; match: string[] }` | Yes | An array of paths that will be matched against the URL hash, rendering the HTML associated with any matched path. If the path is a string, then it will be compared directly to `window.location.hash`. If the path is an object, then it should include a `path` string that will be used to resolve the HTML, and `match` string array that represents multiple paths that should trigger the `path` to be rendered. Defaults to an empty array ('[]'). |
| paths | `string[]` or `PathOptions[]` | Yes | An array of paths that will be matched against the URL hash, rendering the HTML associated with any matched path. If the path is a string, then it will be compared directly to `window.location.hash`. If the path is an object see the `PathOptions` information below. Defaults to an empty array (`[]`). |
| root | `string` | Yes | The ID for the root HTML element. If falsy, then no HTML will be generated. Defaults to an emtpy string (`''`). |
| useManifest | `boolean` | Yes | Determines whether a manifest file should be used to resolve the entries. Defaults to `false`. |
| static | `boolean` | Yes | Removes js and css scripts tags from generated `index.html` files for truly static sites. Not compatible with hash routing. Defaults to `false`. |

**`PathOptions`**

| Property | Type | Optional | Description |
| -------- | ---- | -------- | ----------- |
| path | `string` | No | Path value to match against the URL hash and render HTML for. |
| match | `string[]` | Yes | Multiple paths that should trigger the `path` to be rendered. |
| output | `string` | Yes | Override the path the HTML is output to. |
| static | `boolean` | Yes | Override `options.static` for the path. |


### Usage

Beyond the plugin itself, it is also beneficial to include the `@dojo/webpack-contrib/build-time-render/hasBuildTimeRender` module in the `entry` config option. This file adds the `has('build-item-render')` flag that applications can use to determine whether the app has been pre-rendered.
Expand Down