-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from villander/update-engines
Adds section engines + fastboot
- Loading branch information
Showing
2 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
markdown/guide/deploying-engines.md → markdown/guide/deploying-and-fastboot.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
## Deploying An Engine | ||
## Deploying and Fastboot | ||
|
||
### Deploying An Engine | ||
|
||
In many cases, your engine code may be served from a static server, typically a CDN; this server will probably not share the same root location as your application. In order to specify the location to get the engine assets, you can implement a `generateURI` function in the host application's `ember-cli-build.js` file: | ||
|
||
```js | ||
// host-app/ember-cli-build.js | ||
let app = new EmberApp(defaults, { | ||
assetLoader: { | ||
generateURI: function(filePath) { | ||
generateURI(filePath) { | ||
if (EmberApp.env() === 'production') { | ||
return 'https://production.cdn.com/' + filePath; | ||
return `https://production.cdn.com/${filePath}`; | ||
} else { | ||
return 'local/static/' + filePath; | ||
return `local/static/${filePath}`; | ||
} | ||
} | ||
} | ||
}); | ||
``` | ||
|
||
The `generateURI` function receives the `filePath` for each asset and must return a string of the asset's location. For more info, see the [ember-asset-loader documentation](https://github.com/ember-engines/ember-asset-loader#generating-custom-uris). | ||
|
||
|
||
### Fastboot | ||
|
||
Ember Engines is perfect for combining with server-side rendering solution and works with [FastBoot](https://ember-fastboot.com/) out of the box. | ||
|
||
All Engine builds (regardless of whether they are lazy-loaded or not) will generate a `engines-dist/engine-name/config/environment.js` file. This is because we need to load that file in FastBoot for both eager and lazy engines. |