Skip to content

Commit 6ebfff9

Browse files
committed
Prevented usage of localhost siteUrl in production mode
1 parent 1993613 commit 6ebfff9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ typings/
7373
public
7474
yarn-error.log
7575
.netlify/
76+
77+
# Local Netlify folder
78+
.netlify

gatsby-config.js

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ try {
2222
}
2323
}
2424

25+
if (process.env.NODE_ENV === `production` && config.siteUrl === `http://localhost:8000` && !process.env.SITEURL) {
26+
throw new Error(`siteUrl can't be localhost and needs to be configured in siteConfig. Check the README.`) // eslint-disable-line
27+
}
28+
2529
/**
2630
* This is the place where you can tell Gatsby which plugins to use
2731
* and set them up the way you want.

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build]
2-
command = "gatsby build"
2+
command = "NODE_ENV=production gatsby build"
33
publish = "public/"
44

55
[template]

0 commit comments

Comments
 (0)