mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #14426 from GiedriusGrabauskas/patch-10
SystemJS ConfigMap fix
This commit is contained in:
Vendored
+1
-1
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user