Skip to content

Commit

Permalink
Handle fingerprinted asset map files
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjan Singh committed Sep 20, 2016
1 parent 2e913eb commit d0b1c21
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/broccoli/fastboot-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Funnel = require('broccoli-funnel');
var Funnel = require('broccoli-funnel');
var Plugin = require('broccoli-plugin');
var defaults = require('lodash.defaults');

Expand All @@ -17,19 +17,23 @@ function EmptyTree(inputNodes, options) {
EmptyTree.prototype.build = function() { };

function FastBootBuild(options) {
this.assetMapPath = options.assetMapPath || 'assets/assetMap.json';
this.project = options.project;
var defaultAssetMapPath = 'assets/assetMap.json';
var assetRev = this.project.addons.filter(function(addon) {
return addon.name === 'broccoli-asset-rev';
})[0];

if (assetRev) {
if (assetRev.options && assetRev.options.assetMapPath) {
if (assetRev && assetRev.options) {
if (assetRev.options.assetMapPath) {
this.assetMapPath = assetRev.options.assetMapPath;
}

if (assetRev.options.fingerprintAssetMap) {
defaultAssetMapPath = 'assets/assetMap-*.json'
}
}

this.assetMapPath = this.assetMapPath || 'assets/assetMap.json';
this.assetMapPath = this.assetMapPath || options.assetMapPath || defaultAssetMapPath;
this.ui = options.ui;
this.options = options;
this.app = options.app;
Expand Down

0 comments on commit d0b1c21

Please sign in to comment.