You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @return {Promise<Object>} Returns the created node
323
369
*/
324
-
module.exports=({
370
+
module.exports=functioncreateRemoteFileNode({
325
371
url,
326
372
cache,
327
373
createNode,
@@ -333,7 +379,21 @@ module.exports = ({
333
379
ext =null,
334
380
name =null,
335
381
reporter,
336
-
})=>{
382
+
}){
383
+
if(showFlagWarning){
384
+
showFlagWarning=false
385
+
// Note: This will use a placeholder image as the default for every file that is downloaded through this API.
386
+
// That may break certain cases, in particular when the file is not meant to be an image or when the image
387
+
// is expected to be of a particular type that is other than the placeholder. This API is meant to bypass
388
+
// the remote download for local testing only.
389
+
console.info(
390
+
`GATSBY_EXPERIMENTAL_REMOTE_FILE_PLACEHOLDER: Any file downloaded by \`createRemoteFileNode\` will use the same placeholder image and skip the remote fetch. Note: This is an experimental flag that can change/disappear at any point.`
391
+
)
392
+
console.info(
393
+
`GATSBY_EXPERIMENTAL_REMOTE_FILE_PLACEHOLDER: File to use: \`${process.env.GATSBY_EXPERIMENTAL_REMOTE_FILE_PLACEHOLDER}\``
394
+
)
395
+
}
396
+
337
397
// validation of the input
338
398
// without this it's notoriously easy to pass in the wrong `createNodeId`
0 commit comments