Skip to content

Commit

Permalink
[issue-8348] webpack url relative to origin path
Browse files Browse the repository at this point in the history
  • Loading branch information
palerdot committed Nov 6, 2018
1 parent 41d53dc commit 7f38255
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,11 @@ module.exports = async (
}

function getHmrPath() {
let hmrBasePath = `${program.ssl ? `https` : `http`}://${
program.host
}:${webpackPort}/`

// ref: https://github.com/gatsbyjs/gatsby/issues/8348
// construct the webpack url relative to where the request is coming from
const hmrBasePath = `/`
const hmrSuffix = `__webpack_hmr&reload=true&overlay=false`

if (process.env.GATSBY_WEBPACK_PUBLICPATH) {
const pubPath = process.env.GATSBY_WEBPACK_PUBLICPATH
if (pubPath.substr(-1) === `/`) {
hmrBasePath = pubPath
} else {
hmrBasePath = `${pubPath}/`
}
}

return hmrBasePath + hmrSuffix
}

Expand Down

0 comments on commit 7f38255

Please sign in to comment.