2
votes

I want to have a manifest in my ember app, because I want to use it on mobile devices and have some offline capabilities.

I have found the plugin ember-cli-deploy-manifest: https://github.com/ember-cli-deploy/ember-cli-deploy-manifest It is well documented in the readme and looked promising.

But how do I use the plugin?

I have installed it using this command:

ember install ember-cli-deploy-manifest

I build my app using this command:

ember build -prod

No manifest is created. I am probably missing some simple step, but can't figure it out. How do I tell ember build to use the plugin?

UPDATE

I followed the suggestion in the comment of the answer below. I dropped using the manifest-plugin and created a manifest file manually. Then the challenge is to get proper fingerprinted filenames in the manifest file.

In my ember-cli-build.js file I have:

module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
      fingerprint: {
        exclude: [],
        extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map'],
        replaceExtensions: ['html','css','js', 'appcache']
      }
    });
 ...

My manifest file is called eea.appcache and is located in the /public folder. It is copied to the dist-folder during build. However the content of the file (the list of filenames) are not fingerprinted. Filenames in the other files (html, css, js) are fingerprinted correctly.

Here is my public/eea.appcache:

CACHE MANIFEST
# 2016-03-15
# V 1.0

CACHE:
index.html
assets/vendor.css
assets/eea.css
assets/vendor.js
assets/eea.js
assets/img/Icon120x120.png

My buildstep is still:

ember build -prod

How to get the filenames in the manifets files updated with the MD5 fingerprint?

2
The ember-cli-deploy-manifest is for use with ember-cli-deploy ember-cli.com/ember-cli-deploy .kiwiupover

2 Answers

0
votes

The ember-cli-deploy-manifest is for use with ember-cli-deploy.

So you need to run ember deploy -production once you have installed ember deploy.

Install ember-cli-deploy

ember install ember-cli-deploy

Then

ember deploy -production
0
votes

I finally got it to work, but this solution is really hack'ish. I figured this out by trial and error.

The broccoli-assets-rev has some tricky rules when it parses a file to find the filenames. The format that are normally used in a manifest file the filenames are not found by the parser.

But if the files are listed in the comments of the file with quotes and correct path is used, it will work. If the manifest file is located in the root of the public folder it will end up in the root of the webpage. Then the paths will be as below.

My file looks like this:

CACHE MANIFEST
# 2016-03-15
# V 1.1
# '
# 'assets/vendor.css'
# 'assets/eea.css'
# 'assets/vendor.js'
# 'assets/eea.js'
# 'assets/img/Icon120x120.png'

CACHE:
index.html
assets/vendor.css
assets/eea.css
assets/vendor.js
assets/eea.js
assets/img/Icon120x120.png

NETWORK
*

Then the resulting built file looks like this:

CACHE MANIFEST
# 2016-03-15
# V 1.1
# 
# 'assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css'
# 'assets/eea-ddacde3bdf32d3f94c5a01a2054c6f72.css'
# 'assets/vendor-3229c2c849c3d52c0b362d9fee2106ad.js'
# 'assets/eea-4c760118f51f7402db2f0b6074b6960b.js'
# 'assets/img/Icon120x120-40b31b55211fb293dedf556a648aa47e.png'

CACHE:
index.html
assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css
assets/eea-ddacde3bdf32d3f94c5a01a2054c6f72.css
assets/vendor-3229c2c849c3d52c0b362d9fee2106ad.js
assets/eea-4c760118f51f7402db2f0b6074b6960b.js
assets/img/Icon120x120-40b31b55211fb293dedf556a648aa47e.png

NETWORK
*