text: require(`dotenv`).config({
    path: `.env.${process.env.NODE_ENV}`,
  })
  
  module.exports = {
    siteMetadata: {
      title: `GatsbyJS`,
      siteUrl: `https://www.gatsbyjs.org`,
      description: `Blazing fast modern site generator for React`,
      twitter: `@gatsbyjs`,
    },
    mapping: {
      "MarkdownRemark.frontmatter.author": `AuthorYaml`,
    },
    plugins: [
      {
        resolve: `gatsby-source-npm-package-search`,
        options: {
          keywords: [`gatsby-plugin`, `gatsby-component`],
        },
      },
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `docs`,
          path: `${__dirname}/../docs/`,
        },
      },
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `packages`,
          path: `${__dirname}/../packages/`,
        },
      },
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `ecosystem`,
          path: `${__dirname}/src/data/ecosystem/`,
        },
      },
      {
        resolve: `gatsby-plugin-typography`,
        options: {
          pathToConfigModule: `src/utils/typography`,
        },
      },
      `gatsby-transformer-documentationjs`,
      `gatsby-transformer-yaml`,
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          path: `${__dirname}/src/data/diagram`,
        },
      },
      {
        resolve: `gatsby-transformer-remark`,
        options: {
          plugins: [
            {
              resolve: `gatsby-remark-katex`,
              options: {
                macros: '\def\rvepsilon{{\mathbf{\epsilon}}}'
              },
            },
            `gatsby-remark-draw`,
            `gatsby-remark-code-titles`,
            {
              resolve: `gatsby-remark-images`,
              options: {
                maxWidth: 786,
                backgroundColor: `#ffffff`,
                showCaptions: true,
              },
            },
            {
              resolve: `gatsby-remark-responsive-iframe`,
              options: {
                wrapperStyle: `margin-bottom: 1.05rem`,
              },
            },
            `gatsby-remark-autolink-headers`,
            `gatsby-remark-prismjs`,
            `gatsby-remark-copy-linked-files`,
            `gatsby-remark-smartypants`,
          ],
        },
      },
      {
        resolve: `gatsby-plugin-nprogress`,
        options: {
          color: `#9D7CBF`,
          showSpinner: false,
        },
      },
      `gatsby-plugin-emotion`,
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
      `gatsby-plugin-catch-links`,
      `gatsby-plugin-layout`,
      `gatsby-plugin-lodash`,
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: `GatsbyJS`,
          short_name: `GatsbyJS`,
          start_url: `/`,
          background_color: `#ffffff`,
          theme_color: `#663399`,
          display: `minimal-ui`,
          icon: `src/assets/gatsby-icon.png`,
        },
      },
      `gatsby-plugin-offline`,
      `gatsby-transformer-csv`,
      `gatsby-plugin-twitter`,
      `gatsby-plugin-react-helmet`,
      `gatsby-plugin-sitemap`,
      {
        resolve: `gatsby-plugin-google-analytics`,
        options: {
          trackingId: `UA-93349937-5`,
        },
      },
      {
        resolve: `gatsby-plugin-feed`,
        options: {
          feeds: [
            {
              query: `
                {
                  allMarkdownRemark(
                    sort: { order: DESC, fields: [frontmatter___date] }
                    filter: {
                      frontmatter: { draft: { ne: true } }
                      fileAbsolutePath: { regex: "/docs.blog/" }
                    }
                  ) {
                    edges {
                      node {
                        excerpt
                        html
                        frontmatter {
                          title
                          date
                          excerpt
                          author {
                            id
                          }
                        }
                        fields {
                          slug
                        }
                      }
                    }
                  }
                }
              `,
              output: `/blog/rss.xml`,
              setup: ({
                query: {
                  site: { siteMetadata },
                },
              }) => {
                return {
                  title: siteMetadata.title,
                  description: siteMetadata.description,
                  feed_url: siteMetadata.siteUrl + `/blog/rss.xml`,
                  site_url: siteMetadata.siteUrl,
                  generator: `GatsbyJS`,
                }
              },
              serialize: ({ query: { site, allMarkdownRemark } }) =>
                allMarkdownRemark.edges.map(({ node }) => {
                  return {
                    title: node.frontmatter.title,
                    description: node.frontmatter.excerpt || node.excerpt,
                    url: site.siteMetadata.siteUrl + node.fields.slug,
                    guid: site.siteMetadata.siteUrl + node.fields.slug,
                    custom_elements: [{ "content:encoded": node.html }],
                    author: node.frontmatter.author.id,
                  }
                }),
            },
          ],
        },
      },
      `gatsby-plugin-netlify`,
      `gatsby-plugin-netlify-cache`,
      // {
      //   resolve: `gatsby-plugin-mailchimp`,
      //   options: {
      //     endpoint: `https://gatsbyjs.us17.list-manage.com/subscribe/post?u=1dc33f19eb115f7ebe4afe5ee&amp;id=f366064ba7`,
      //   },
      // },
      {
        resolve: `gatsby-transformer-screenshot`,
        options: {
          nodeTypes: [`StartersYaml`],
        },
      },
      `gatsby-plugin-subfont`,
      // {
      // resolve: `gatsby-plugin-guess-js`,
      // options: {
      // GAViewID: `142357465`,
      // // The "period" for fetching analytic data.
      // period: {
      // startDate: new Date(`2018-1-1`),
      // endDate: new Date(),
      // },
      // },
      // },
    ],
  }
  