Ember-cli-amd
The Ember loader is conflicting with the AMD loader. The Ember loader is not async and doesn't comply with the RequireJS or AMD specs.
This addon will:
- Update the code generated by Ember to avoid conflicts with the AMD loader
- Update the index.html:
- load any pure AMD modules found in the code first using the AMD loader.
- load the Ember code as AMD modules (app and vendor)
- reference the AMD modules inside the Ember loader
View it live using the ArcGIS API for JavaScript.
Breaking changes
The version 2.x has removed some old and unecessary features.
Features
Usage
ember install ember-cli-amd
Update the ember-cli-build file. See configuration below as an example:
var app = new EmberApp({
amd : {
loader: 'https://js.arcgis.com/4.11/',
packages: ['esri','dojo','dojox','dijit','put-selector','xstyle','dgrid'],
configPath: 'config/dojo-config.js',
excludePaths: ['assets/jsapi', 'assets/myLibThatDontUseEmberDefineOrRequire']
}
});
Example using the CDN resources
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
amd :{
loader: 'https://js.arcgis.com/3.15/',
configPath: 'config/dojo-config.js',
packages: ['esri','dojo','dojox','dijit','put-selector','xstyle','dbind','dgrid'],
excludePaths: ['assets/workers']
}
});
return app.toTree();
};
var dojoConfig = {
async: true
};
Resources
Issues
Find a bug or want to request a new feature? Please let us know by submitting an issue.
Contributing
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Licensing
Copyright 2018 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's LICENSE file