Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Jun 26, 2017
1 parent 04b1ceb commit 6b340a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/lib/asset-manager/asset-url-generator.js
Expand Up @@ -11,7 +11,7 @@ const loadAssetHashesJson = path => {
}
}

module.exports = (appName, directory, useLocalAppShell) => {
module.exports = ({ appName, isProduction, directory, useLocalAppShell }) => {

const assetHashes = loadAssetHashesJson(`${directory}/public/asset-hashes.json`);
const nUiAssetHashes = loadAssetHashesJson(`${directory}/public/n-ui-asset-hashes.json`);
Expand All @@ -36,7 +36,7 @@ module.exports = (appName, directory, useLocalAppShell) => {
} else {
const fallback = `/${appName}/${file}`;
const hash = assetHashes[file];
return (!locals.__isProduction || !hash) ? fallback : `//www.ft.com/__assets/hashed/${appName}/${hash}`;
return (!isProduction || !hash) ? fallback : `//www.ft.com/__assets/hashed/${appName}/${hash}`;
}
}

Expand Down
7 changes: 4 additions & 3 deletions server/lib/asset-manager/index.js
Expand Up @@ -31,11 +31,12 @@ function init (options, directory, app) {
}

// initialise helper for calculating paths to assets
const getAssetUrl = assetUrlGenerator(
app.locals.__name,
const getAssetUrl = assetUrlGenerator({
appName: app.locals.__name,
isProduction: app.locals.__isProduction,
directory,
useLocalAppShell
);
});

//expose the asset hashing helper to apps (in case they build non-standard files)
// TODO deprecate this name in future release
Expand Down

0 comments on commit 6b340a6

Please sign in to comment.