// ─────────────────────────────────────────────────────────────────────────────
// import
// ─────────────────────────────────────────────────────────────────────────────

var proxy = require("http-proxy-middleware");

// ─────────────────────────────────────────────────────────────────────────────
// component
// ─────────────────────────────────────────────────────────────────────────────

module.exports = {
  siteMetadata: {
    title:   'mrozilla',
    siteUrl: 'https://www.mrozilla.cz',
  },
  developMiddleware: (app) => {
    app.use(
      '/.netlify/functions/',
      proxy({
        target:      'http://localhost:9000',
        pathRewrite: {
          '/.netlify/functions/': '',
        },
      }),
    );
  },
  plugins: [
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'content',
        path: `${__dirname}/src/content`,
      },
    },

    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 590,
            },
          },
          {
            resolve: 'gatsby-remark-prismjs',
            options: {
              classPrefix:      'language-',
              inlineCodeMarker: null,
              aliases:          {},
            },
          },
        ],
      },
    },
    'gatsby-transformer-json',
    'gatsby-transformer-sharp',

    {
      resolve: 'gatsby-plugin-google-analytics',
      options: {
        trackingId: process.env.GATSBY_GA_TRACKING_ID,
        head:       true,
        anonymize:  true,
        respectDNT: true,
      },
    },
    {
      resolve: 'gatsby-plugin-manifest',
      options: {
        name:             'mrozilla: one-man digital studio',
        short_name:       'mrozilla',
        start_url:        '/',
        background_color: '#ffffff',
        theme_color:      '#000000',
        display:          'minimal-ui',
        icon:             'src/content/multimedia/favicon.png',
      },
    },
    {
      resolve: 'gatsby-plugin-robots-txt',
      options: {
        resolveEnv: () => process.env.CONTEXT,
        env:        {
          production: {
            policy: [{ userAgent: '*' }],
          },
          'branch-deploy': {
            policy:  [{ userAgent: '*', disallow: ['/'] }],
            sitemap: null,
            host:    null,
          },
          'deploy-preview': {
            policy:  [{ userAgent: '*', disallow: ['/'] }],
            sitemap: null,
            host:    null,
          },
        },
      },
    },
    'gatsby-plugin-sharp',
    'gatsby-plugin-sitemap',
    'gatsby-plugin-offline',
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-styled-components',
    'gatsby-plugin-netlify',
  ],
};

@@ -170,11 +170,13 @@
 %E2%94%80%E2%94%80%0A%0A
-var
+const
  pro
@@ -188,17 +188,17 @@
 require(
-%22
+'
 http-pro
@@ -214,9 +214,9 @@
 ware
-%22
+'
 );%0A%0A

clean up