Ember-cli-amd
This addon will dynamically modify loader.js
to allow it to work in parallel with a separate AMD loader.
Thanks to Jack Rowlingson for figuring out how to use an AMD loader and ember-cli loader concurrently.
View it live using the ArcGIS API for JavaScript.
Features
Installation
git clone
this repositorynpm install
bower install
Usage
Install to your ember-cli application
npm install --save ember-cli-amd
Provide a list of packages that will be loaded via an AMD loader such as RequireJS or Dojo. You can also provide the source for the loader.
var app = new EmberApp({
srcTag: 'https://js.arcgis.com/3.13/',
useRequire: false,
useDojo: false
locale: 'en-us',
amdPackages: [
'esri','dojo','dojox','dijit',
'put-selector','xstyle','dgrid'
],
amdBase: 'bower_components/amdlibrary',
requireConfig: {
include: [
'foo/bar/baz'
],
exclude: [
'lorem/ipsum'
],
paths: {
'plugins/plugin': 'empty:'
}
}
});
Update the index.html
file to allow this addon to add script files as needed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EsrijsApp</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
{{content-for 'head-footer'}}
</head>
<body>
<script>
var reqConfig = {};
</script>
{{content-for 'amd'}}
{{content-for 'body'}}
{{content-for 'body-footer'}}
</body>
</html>
Update this ENV
object in config/environment.js
to allow pulling in CDN resources such as with the ArcGIS API for JavaScript.
var ENV = {
...
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' 'unsafe-eval' 'unsafe-inline' http://js.arcgis.com/ https://js.arcgis.com/",
'font-src': "'self'",
'connect-src': "'self' http://services.arcgis.com/ http://services.arcgisonline.com/",
'img-src': "'self' http://js.arcgis.com/",
'style-src': "'self' 'unsafe-inline'",
'media-src': "'self'"
}
Running
Running Tests
ember test
ember test --server
Building
Requirements
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 2015 Esri
Licensed under The MIT License(MIT);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
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.md file.
[](Esri Tags: ember-cli-amd)
[](Esri Language: JavaScript)