Skip to content

Commit

Permalink
Fix bad logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Scotty Eckenthal committed May 18, 2017
1 parent 78bad67 commit 4563b4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/gatsby/src/cache-dir/static-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ module.exports = (locals, callback) => {
]
dascripts.forEach(script => {
const fetchKey = `assetsByChunkName[${script}]`
let prefixedScript = `${linkPrefix}${get(stats, fetchKey, ``)}`

let fetchedScript = get(stats, fetchKey)
// If sourcemaps are enabled, then the entry will be an array with
// the script name as the first entry.
prefixedScript = isArray(prefixedScript) ? prefixedScript[0] : prefixedScript
fetchedScript = isArray(fetchedScript) ? fetchedScript[0] : fetchedScript
const prefixedScript = `${linkPrefix}${fetchedScript}`

// Make sure we found a component.
if (prefixedScript === `/`) {
Expand Down

0 comments on commit 4563b4b

Please sign in to comment.