Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 9bd9b0b

Browse files
committed
add systemjs paths key clarification
1 parent f1aa95b commit 9bd9b0b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

public/docs/_examples/production-deploy/ts/systemjs.config.server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
*/
77
(function (global) {
88
System.config({
9+
// #docregion paths
910
paths: {
1011
'npm:': 'https://unpkg.com/' // path serves as alias
1112
},
13+
// #enddocregion paths
1214
// map tells the System loader where to look for things
1315
map: {
1416
app: 'app', // location of transpiled app files

public/docs/ts/latest/guide/production-deploy.jade

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,20 @@ a#toc
6666
(3) Add `systemjs.config.server.js` (shown in the code sample below) to your root folder.
6767
This alternative version configures _SystemJS_ to load _UMD_ versions of Angular
6868
(and other third-party packages) from the web.
69-
Modify it as necessary to stay in sync with changes you make to `systemjs.config.js`.
69+
70+
Pay special attention to the `paths` key:
71+
72+
+makeExample('systemjs.config.server.js', 'paths', '')(format=".")
73+
74+
:marked
75+
In your usual SystemJS config the `npm` path points at your local `node_modules/`,
76+
but on the server config it points at https://unpkg.com/ - a site that hosts NPM packages.
77+
78+
This way you can load your node modules from the internet directly.
79+
You can use any other provider you which, as long as it serves the needed files.
80+
81+
Modify `systemjs.config.server.js` as necessary to stay in sync with changes
82+
you make to `systemjs.config.js`.
7083

7184
The following trivial router sample app shows these changes.
7285

0 commit comments

Comments
 (0)