Skip to content

Commit

Permalink
added public path env option for webpack (#5527)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebigredgeek committed Jun 8, 2018
1 parent 129b36a commit a2df1bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ module.exports = async (
return {
path: directory,
filename: `[name].js`,
publicPath: `http://${program.host}:${webpackPort}/`,
// Add /* filename */ comments to generated require()s in the output.
pathinfo: true,
// Point sourcemap entries to original disk location (format as URL on Windows)
publicPath: process.env.GATSBY_WEBPACK_PUBLICPATH || `${program.ssl ? `https` : `http`}://${
program.host
}:${webpackPort}/`,
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, `/`),
}
Expand Down

0 comments on commit a2df1bb

Please sign in to comment.