Merge pull request #14426 from GiedriusGrabauskas/patch-10

SystemJS ConfigMap fix
This commit is contained in:
Arthur Ozga
2017-02-07 11:44:14 -08:00
committed by GitHub
2 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ declare namespace SystemJSLoader {
*/
type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | boolean;
type ConfigMap = PackageList<string>;
type ConfigMap = PackageList<string | PackageList<string>>;
type ConfigMeta = PackageList<MetaConfig>;
+20 -11
View File
@@ -1,14 +1,12 @@
import SystemJS = require('systemjs');
import System = require('systemjs');
System.config({
SystemJS.config({
baseURL: '/app'
});
System.import('main.js');
SystemJS.import('main.js');
System.config({
SystemJS.config({
// or 'traceur' or 'typescript'
transpiler: 'babel',
// or traceurOptions or typescriptOptions
@@ -18,22 +16,33 @@ System.config({
});
System.config({
SystemJS.config({
map: {
traceur: 'path/to/traceur.js'
}
});
System.transpiler = 'traceur';
SystemJS.config({
map: {
'local/package': {
x: 'vendor/x.js'
},
'another/package': {
x: 'vendor/y.js'
}
}
});
SystemJS.transpiler = 'traceur';
// loads './app.js' from the current directory
System.import('./app.js').then(function (m) {
SystemJS.import('./app.js').then(function (m) {
console.log(m);
});
System.import('lodash').then(function (_) {
SystemJS.import('lodash').then(function (_) {
console.log(_);
});
const clonedSystemJS = new System.constructor();
const clonedSystemJSJS = new SystemJS.constructor();