From fa1585f9a3f7da71b79ff78929f65d88fad2cc08 Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Wed, 1 Feb 2017 19:58:01 +0200 Subject: [PATCH 1/4] Fixed ConfigMap object hierarchy Read more here: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9744 --- systemjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs/index.d.ts b/systemjs/index.d.ts index 428e303442..f759ba3f91 100644 --- a/systemjs/index.d.ts +++ b/systemjs/index.d.ts @@ -29,7 +29,7 @@ declare namespace SystemJSLoader { */ type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | boolean; - type ConfigMap = PackageList; + type ConfigMap = PackageList>; type ConfigMeta = PackageList; From 8f90dd420a0a8a55261180cac0606975907f346b Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Wed, 1 Feb 2017 20:00:49 +0200 Subject: [PATCH 2/4] Updated systemjs tests Updated SystemJS naming. Added test with ConfigMap hierarchy. --- systemjs/systemjs-tests.ts | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/systemjs/systemjs-tests.ts b/systemjs/systemjs-tests.ts index 3c2f8ebadc..f24c01b537 100644 --- a/systemjs/systemjs-tests.ts +++ b/systemjs/systemjs-tests.ts @@ -1,14 +1,12 @@ +import SystemJS = require('SystemJSjs'); - -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(); From 0455fb3c6d3c75981db3c0acdee2e594e106cc7b Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Wed, 1 Feb 2017 20:25:38 +0200 Subject: [PATCH 3/4] Fixed refactoring. --- systemjs/systemjs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs/systemjs-tests.ts b/systemjs/systemjs-tests.ts index f24c01b537..53eeba8a2a 100644 --- a/systemjs/systemjs-tests.ts +++ b/systemjs/systemjs-tests.ts @@ -1,4 +1,4 @@ -import SystemJS = require('SystemJSjs'); +import SystemJS = require('Systemjs'); SystemJS.config({ baseURL: '/app' From 16ce688ad7b110afc2ec765f6c264a208bd25a02 Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Wed, 1 Feb 2017 20:26:18 +0200 Subject: [PATCH 4/4] Fixed import. --- systemjs/systemjs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs/systemjs-tests.ts b/systemjs/systemjs-tests.ts index 53eeba8a2a..fa0ddbedaf 100644 --- a/systemjs/systemjs-tests.ts +++ b/systemjs/systemjs-tests.ts @@ -1,4 +1,4 @@ -import SystemJS = require('Systemjs'); +import SystemJS = require('systemjs'); SystemJS.config({ baseURL: '/app'