Adding this part in both files, every link gets build as expected BUT the links in index.js.
The links build in this file now have double BASEURL, e.g. /public/public/....
Because the pathPrefix variable gets now picked up in gatsby-config.js and is automatically added in Gatsby Link components, it gets double added there.
Just wanted to check back, if I'm missing something out here or if this is somehow wanted behaviour.
Working on #119 I had some issues using the environment variables.
When I copy the
.env.example
to.env.production
and addBASEURL=/public
, e.g.and then run
npm run build
, theBASEURL
is only picked up inindex.js
, all other links are build without/public
.Reading here: https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/ I think it's because the following is missing in
gatsby-config.js
andgatsby-node.js
:Adding this part in both files, every link gets build as expected BUT the links in
index.js
. The links build in this file now have doubleBASEURL
, e.g./public/public/...
.I think this is because of using Gatsby link component there: https://github.com/skohub-io/skohub-vocabs/blob/8f57d586fb394f8eb82afceca69b48f9a39dcf21/src/components/index.js#L15-L17
Because the
pathPrefix
variable gets now picked up ingatsby-config.js
and is automatically added in Gatsby Link components, it gets double added there.Just wanted to check back, if I'm missing something out here or if this is somehow wanted behaviour.