Skip to content

Commit

Permalink
fix(demo): re-add a missing systemjs config file
Browse files Browse the repository at this point in the history
  • Loading branch information
DethAriel committed Apr 25, 2017
1 parent 9664203 commit b51694a
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions demo/examples/systemjs.config.js
@@ -0,0 +1,70 @@
(function (global) {
global.initSystemJS = function (recaptchaMapping, loadForms) {
// lock in the angular package version; do not let it float to current!
var ngVer = '@4.0.0';

//map tells the System loader where to look for things
var map = {
'examples': './examples/app',

'@angular': 'https://npmcdn.com/@angular', // sufficient if we didn't pin the version
'rxjs': 'https://npmcdn.com/rxjs@5.2.0',
'ts': 'https://npmcdn.com/plugin-typescript@4.0.10/lib/plugin.js',
'typescript': 'https://npmcdn.com/typescript@2.2.0/lib/typescript.js',
'ng-recaptcha': recaptchaMapping,
};

//packages tells the System loader how to load when no filename and/or no extension
var packages = {
'examples': { defaultExtension: 'ts' },
'ng-recaptcha': { main: 'index.js', defaultExtension: 'js' },
};

var ngPackageNames = [
'common',
'compiler',
'core',
'platform-browser',
'platform-browser-dynamic',
];

if (loadForms) {
ngPackageNames.push('forms');
}

ngPackageNames.forEach(function (pkgName) {
// Add map entries for each angular package
// only because we're pinning the version with `ngVer`.
map['@angular/' + pkgName] = 'https://npmcdn.com/@angular/' + pkgName + ngVer;
// Add package entries for angular packages
packages['@angular/' + pkgName] = { main: 'bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
});

var config = {
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
transpiler: 'ts',
typescriptOptions: {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": false,
"declaration": true,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"listFiles": false,
"noLib": false
},
meta: {
'typescript': {
"exports": "ts"
}
},
map: map,
packages: packages
}

System.config(config);
};
})(this);

0 comments on commit b51694a

Please sign in to comment.