This example demonstrates how to load modules that are external to tsCodeHub.
Two files, system.config.json and types.config.json override the loading of modules when defined.
The type information is provided by types.config.json.
The runtime JavaScript is defined by system.config.json.
You may also define instead system.config.js.
System.config({
"paths": {
"cdn:": "https://unpkg.com/"
},
"map": {
"eight": "cdn:davinci-eight@6.1.3/build/browser/index.js"
},
"packages": {
"eight": {
"defaultExtension": "js"
}
}
});Both of these files map module names to resource URL(s) that provide either the JavaScript (js) or type definitions (d.ts).
A current limitation is that the d.ts files must be flattened.
We use https://unpkg.com as the CDN because it is automatically mapped to NPM. Thus, it is only necessary to publish your packages (including d.ts files) to NPM to use them in tsCodeHub.
Copyright (c) 2015-2017 David Geo Holmes.