Skip to content

Commit

Permalink
docs(overview): Added docs section for SystemJS configuration (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored and MikeRyanDev committed May 15, 2016
1 parent a944c6c commit 407bcee
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ That's it! You are ready to begin taking advantage of reactive routing!
* [Code Splitting](./docs/overview/code-splitting.md)
* [Route and Query Parameters](./docs/overview/params.md)
* [Guarding Routes](./docs/overview/guards.md)
* [SystemJS Configuration](./docs/overview/systemjs.md)
48 changes: 48 additions & 0 deletions docs/overview/systemjs.md
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'
}
}
});
```

0 comments on commit 407bcee

Please sign in to comment.