Add Files using a Gatsby Recipe

Khaled Garbaya
InstructorKhaled Garbaya
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 4 years ago

Often times packages will require their own bespoke configuration files apart from NPM installing and configuring in gatsby-config.js or you may want additional files present for doing things like setting global styles. We can handle this by creating files within a Gatsby Recipe.

In this lesson, we will create a handful of Files within a Gatsby Recipe to configure tailwindcss and postcss. We will also see how we can create an example usage of tailwind within gatsby as part of the recipe.

Khaled Garbaya: [0:00] Using Gatsby Recipes, you can also create files. To do that, let's create a new step and add here a description and use the file JSX component. We will type File. We'll give it a path. This one will be postcss.config.js and the content. The content can be a URL to some text content. I'm going to paste a link here. We close the component.

[0:38] I will add three more files. Then I will add a final step and add the description here. Let's save and go to our terminal and run the recipe again. Let me skip to the step that we need. Here, we can see the third step that we added, which is adding a few files. You can see here the diff and what will change. Let's hit enter. We're done.

egghead
egghead

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today