Skip to content

Instantly share code, notes, and snippets.

@odoe
Created December 21, 2015 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/696a36de99a1c5307552 to your computer and use it in GitHub Desktop.
Save odoe/696a36de99a1c5307552 to your computer and use it in GitHub Desktop.
declare var System: any;
const deps = [
'esri/Map',
'esri/views/MapView',
'esri/widgets/Home/HomeViewModel',
'dojo/topic'
];
const moduleName = (name) => name.match(/[^\/]+$/).shift();
System.config({
packages: {
app: {
defaultExtension: 'js'
}
}
});
function register(name: string, mods: any[]) {
System.register(name, [], exp => {
return {
setters: [],
execute: () => {
mods.map((mod: any, idx: number) => {
exp(moduleName(deps[idx]), mod);
});
}
}
});
}
require(deps, function(...modules) {
register('esri-mods', modules);
System.import('app/boot')
.then(null, console.error.bind(console));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment