-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(overview): Added docs section for SystemJS configuration (#106)
- Loading branch information
1 parent
a944c6c
commit 407bcee
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# SystemJS Configuration | ||
`SystemJS` is a universal dynamic module loader for loading various module formats in the browser and NodeJS. Using `@ngrx/router` with SystemJS as a dynamic module loader requires a bit more setup due to external dependencies. | ||
|
||
### Setup | ||
|
||
Below is an example of a SystemJS config which maps `@ngrx/router` to its npm package folder along with its external dependencies including `path-to-regexp`, `isarray`, `query-string` and `strict-uri-encode`. If you have an existing SystemJS config, just add `@ngrx/router` sections to your configuration. | ||
|
||
```js | ||
|
||
System.config({ | ||
map: { | ||
// @ngrx/router | ||
'@ngrx/router': 'node_modules/@ngrx/router', | ||
|
||
// @ngrx/router dependencies | ||
'path-to-regexp': 'node_modules/path-to-regexp', | ||
'isarray': 'node_modules/isarray', | ||
'query-string': 'node_modules/query-string', | ||
'strict-uri-encode': 'node_modules/strict-uri-encode' | ||
}, | ||
//packages defines our app package | ||
packages: { | ||
// @ngrx/router package | ||
'@ngrx/router': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
}, | ||
|
||
// @ngrx/router dependencies | ||
'path-to-regexp': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
}, | ||
'isarray': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
}, | ||
'query-string': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
}, | ||
'strict-uri-encode': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
} | ||
} | ||
}); | ||
``` |