0.1.0 • Published 7 years ago

ember-engines-microservice v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

ember-engines-microservice

Deploy standalone lazy-loading engines without having to deploy from main ember application for every little changes.

Installation

  • ember install ember-engines-microservice

Usage

Instead of asset manifests injected into the meta tag, it will create dist/engines-dist/engine-name/asset-manifest.js file with all the uri to engines asset.

  • ember serve
  • ember deploy
  • ember build

Prerequisite

Ember App and Ember Engine

  • ember-cli-deploy

Ember Engine

  • Must have the same filterprint option in ember-cli-build.js as the main ember app the engine is mounting to
  • Must have the same config/deploy.js configuration as the main ember app the engine is mounting to

Configuration

Ember Engine

Add isEngine: true in ember-cli-build.js

var app = new EmberAddon(defaults, {
  isEngine: true
});

Ember App

Add below snippet in app/index.html

{{content-for "engine-assets"}}

under

<script src="{{rootURL}}assets/vendor.js"></script>

Example app/index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Dummy</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for "head"}}

    <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
    <link rel="stylesheet" href="{{rootURL}}assets/dummy.css">

    {{content-for "head-footer"}}
  </head>
  <body>
    {{content-for "body"}}

    <script src="{{rootURL}}assets/vendor.js"></script>
    {{content-for "engine-assets"}}
    <script src="{{rootURL}}assets/dummy.js"></script>

    {{content-for "body-footer"}}
  </body>
</html>

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server