Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/gatsby/cache-dir/public-page-renderer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const preferDefault = m => (m && m.default) || m

if (process.env.NODE_ENV === `production`) {
if (process.env.NODE_ENV !== `production`) {
module.exports = preferDefault(require(`./public-page-renderer-dev`))
} else if (process.env.BUILD_STAGE === `build-javascript`) {
module.exports = preferDefault(require(`./public-page-renderer-prod`))
} else {
module.exports = preferDefault(require(`./public-page-renderer-dev`))
}
module.exports = () => null
}
13 changes: 7 additions & 6 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.exports = async (
// Don't allow overwriting of NODE_ENV, PUBLIC_DIR as to not break gatsby things
envObject.NODE_ENV = JSON.stringify(env)
envObject.PUBLIC_DIR = JSON.stringify(`${process.cwd()}/public`)
envObject.BUILD_STAGE = JSON.stringify(stage)

return Object.assign(envObject, gatsbyVarObject)
}
Expand Down Expand Up @@ -186,12 +187,12 @@ module.exports = async (
clearConsole: false,
compilationSuccessInfo: {
messages: [
`You can now view your site in the browser running at ${program.ssl ? `https` : `http`}://${
program.host
}:${program.port}`,
`Your graphql debugger is running at ${program.ssl ? `https` : `http`}://${program.host}:${
program.port
}/___graphql`,
`You can now view your site in the browser running at ${
program.ssl ? `https` : `http`
}://${program.host}:${program.port}`,
`Your graphql debugger is running at ${
program.ssl ? `https` : `http`
}://${program.host}:${program.port}/___graphql`,
],
},
}),
Expand Down