Go Pro Sign Up Login

Buy Now and unlock this series

$

44

.99

$

34

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Gatsby Node

Next, we will be working within the gatsby-node file to create pages programmatically. We will be spending some time on this topic because it is a key feature within Gatsby when creating dynamic sites.

Downloads

Become a pro to download code and videos

Comments

Robb Shoe

about 2 years ago [edited]

I could entirely be wrong about this, but I think it's now possible to use the import syntax within Node since about a year ago (after this video was released) (more info on that at https://thecodebarbarian.com/nodejs-12-imports for anyone interested). There's probably an even better way to do this now that I'm unaware of, but for anyone without VSCode whining at them who wants to do this in the more familiar ES6 syntax, it'd just look like this (assuming you have a recent version of Node installed):

https://pastebin.com/M5Rc4Cg4

Want to join the conversation?

Become a Pro member today!