1.0.0 • Published 7 years ago

systemjs-plugin-dojo v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Dojo loader plugin for SystemJS

Installation

First install this plugin with npm:

npm install systemjs-plugin-dojo

Then add map to the loader:

SystemJS.config({
    map: {
        'dojo-loader': 'node_modules/systemjs-plugin-dojo/dojo.js'
    }
});

Setup

First make sure dojo or esri works through dojoConfig, for example:

(function (global) {
    'use strict';
    global.dojoConfig = {
        async: true,
        baseUrl: '.',
        packages: [
            { name: 'dgrid', location: 'bower_components/dgrid' },
            { name: 'dijit', location: 'bower_components/dijit' },
            { name: 'dojo', location: 'bower_components/dojo' },
            { name: 'dojox', location: 'bower_components/dojox' },
            { name: 'dstore', location: 'bower_components/dstore' },
            { name: 'moment', location: 'bower_components/moment' },
            { name: 'esri', location: 'bower_components/esri' }
        ]
    };
})(window);

And link dojo in your html file:

<script src="dojoConfig.js"></script>
<script src="bower_components/dojo/dojo.js"></script>

Then config all dojo related package load with the loader, for example:

SystemJS.config({
    meta: {
        'dojo/*': { loader: 'dojo-loader' },
        'esri/*': { loader: 'dojo-loader' }
    }
});

Demo

See ng2-esri-demo for more details.

License

MIT

Special thanks to