Skip to content

Commit

Permalink
Upgraded to ember-cli 1.13.12.
Browse files Browse the repository at this point in the history
updated the add-on to update the index.html after the build.
  • Loading branch information
ffaubry committed Nov 13, 2015
1 parent ad688ae commit 4a186d1
Show file tree
Hide file tree
Showing 17 changed files with 470 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .watchmanconfig
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp"]
"ignore_dirs": ["tmp", "dist"]
}
121 changes: 58 additions & 63 deletions README.md
Expand Up @@ -27,30 +27,42 @@ Provide a list of packages that will be loaded via an AMD loader such as Require
// use this in ember-cli-build.js
// Sample if using the ArcGIS API for JavaScript
var app = new EmberApp({
srcTag: 'https://js.arcgis.com/3.14/', // only needed for CDN, will default to 'built.js' if useRequire = true
useRequire: false, // if this is true, srcTag via options is ignored
useDojo: false, // if this is true, will inject the Dojo loader instead of RequireJS
locale: 'en-us', // will use RequireJS i18n to set the localization
amdPackages: [ // user defined AMD packages to search for in application
'esri','dojo','dojox','dijit',
'put-selector','xstyle','dgrid'
],
// will create a dependencies.txt that will list all the
// AMD dependencies in the application
outputDependencyList: true,
amdBase: 'bower_components/amdlibrary', // optional - base folder of AMD library
// RequireJS configuration options
// Please refere to RequireJS docs for more information
// http://requirejs.org/docs/optimization.html
requireConfig: {
include: [
'foo/bar/baz'
],
exclude: [
'lorem/ipsum'
amd : {
// Specify the type of AMD loader. Either a CDN path or a local loader ('dojo' or 'requirejs')
loader: 'https://js.arcgis.com/3.15/',
// user defined AMD packages to search for in application
packages: [
'esri','dojo','dojox','dijit',
'put-selector','xstyle','dgrid'
],
paths: {
'plugins/plugin': 'empty:'
// Optional: the AMD configuration. It can be either an object or a file path. The path is relative to the root
// of the project as amdConfig: 'config/amd-config.js'. For the object properties, refer to either the dojo or the requirejs
// configuration documentation
config: {
},
// If using a local loader ('dojo' or 'rquirejs'), the path to the AMD library must be provided.
libraryPath: 'bower_components/amdlibrary',
// When uing a local loader, we will build the AMD module using requirejs into a single file
// The following properties allow to control the build
// Optional: it defaults to vendor/build.js
outputPath: 'vendor/build.js'
// Optional: Will use RequireJS i18n to set the localization, default is 'en-us'
locale: 'en-us',
// Optional: Will create a dependencies.txt that will list all the AMD dependencies in the application, default is false
outputDependencyList: true,
// RequireJS build configuration options
// Please refere to RequireJS docs for more information
// http://requirejs.org/docs/optimization.html
buildConfig: {
include: [
'foo/bar/baz'
],
exclude: [
'lorem/ipsum'
],
paths: {
'plugins/plugin': 'empty:'
}
}
}
});
Expand All @@ -67,29 +79,16 @@ Update the `index.html` file to allow this addon to add script files as needed.
<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">

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/app.css">
{{content-for 'head-footer'}}

</head>
<body>
<!-- This script tag must come before the content-for "amd" block -->
<script>
// Please refere to RequireJS configuration options
// http://requirejs.org/docs/api.html#config
// If using Dojo, this configuration will be treated like dojoConfig.
// Please refer to Dojo documentation for details
// http://dojotoolkit.org/documentation/tutorials/1.10/dojo_config/
var reqConfig = {};
</script>

{{content-for 'amd'}}

{{content-for 'body'}}

{{content-for 'body-footer'}}

<!-- We removed the app and vendor js files as they will be inserted by the addon -->
{{content-for 'body-footer'}}
</body>
</html>
```
Expand All @@ -109,24 +108,24 @@ Update the `test/index.html` file to allow this addon to add script files as nee
{{content-for 'test-head'}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/ember-esri.css">
<link rel="stylesheet" href="assets/ember-test.css">
<link rel="stylesheet" href="assets/test-support.css">

{{content-for 'head-footer'}}
{{content-for 'test-head-footer'}}
</head>
<body>

{{content-for 'amd-test'}}
{{content-for 'body'}}
{{content-for 'test-body'}}
{{content-for 'amd-test'}}
<!-- We removed the app, vendor, and test js files as they will be inserted by the addon -->
{{content-for 'body-footer'}}
{{content-for 'test-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.
If using ember-cli-content-security-policy, update this `ENV` object in `config/environment.js` to allow pulling in CDN resources such as with the ArcGIS API for JavaScript.
```javascript
var ENV = {
...
Expand All @@ -146,13 +145,22 @@ var ENV = {
```javascript
// ember-cli-build.js
module.exports = function(defaults) {

var app = new EmberApp(defaults, {
srcTag: 'https://js.arcgis.com/3.14/',
amdPackages: [
'esri','dojo','dojox','dijit',
'put-selector','xstyle','dbind','dgrid'
]
amd :{
loader: 'https://js.arcgis.com/3.14/',
amdPackages: [
'esri','dojo','dojox','dijit',
'put-selector','xstyle','dbind','dgrid'
],
config: {
async: true,
locale: 'en-us',
isDebug: true
}
}
});

return app.toTree();
};
```
Expand All @@ -168,27 +176,14 @@ module.exports = function(defaults) {
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}

<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/arcgis-app.css">

{{content-for 'head-footer'}}

</head>
<body>
<script>
var reqConfig = {
locale: 'en-us',
isDebug: true
};
var dojoConfig = reqConfig;
dojoConfig.async = true;
</script>

{{content-for 'amd'}}

{{content-for 'body'}}

{{content-for 'body-footer'}}
</body>
</html>
Expand Down
22 changes: 11 additions & 11 deletions bower.json
@@ -1,16 +1,16 @@
{
"name": "ember-cli-amd",
"dependencies": {
"ember": "1.13.4",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.13.5",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.1",
"ember": "1.13.10",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-data": "1.13.15",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.0.7",
"ember-resolver": "~0.1.18",
"jquery": "^1.11.1",
"loader.js": "ember-cli/loader.js#3.2.0",
"qunit": "~1.17.1"
"ember-resolver": "~0.1.20",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.2.1",
"qunit": "~1.20.0"
}
}
}
1 change: 1 addition & 0 deletions config/ember-try.js
@@ -1,3 +1,4 @@
/*jshint node:true*/
module.exports = {
scenarios: [
{
Expand Down
1 change: 1 addition & 0 deletions config/environment.js
@@ -1,3 +1,4 @@
/*jshint node:true*/
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
5 changes: 3 additions & 2 deletions ember-cli-build.js
@@ -1,8 +1,9 @@
/*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-addon');
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberApp(defaults, {
var app = new EmberAddon(defaults, {
// Add options here
});

Expand Down

0 comments on commit 4a186d1

Please sign in to comment.