text: const fs = require("fs-extra");
  const path = require("path");
  
  exports.onPostBootstrap = () => {
    console.log("Copying locales");
    fs.copySync(
      path.join(__dirname, "/src/locales"),
      path.join(__dirname, "/public/locales"),
    );
  };
  
  exports.createPages = ({ actions, graphql }) => {
    const { createPage } = actions;
  
    const blogPostTemplate = path.resolve(`src/templates/BlogPost.js`);
  
    return graphql(`
      {
        allMarkdownRemark(
          sort: { order: DESC, fields: [frontmatter___date] }
          limit: 1000
        ) {
          edges {
            node {
              frontmatter {
                path
              }
            }
          }
        }
      }
    `).then(result => {
      if (result.errors) {
        return Promise.reject(result.errors);
      }
  
      result.data.allMarkdownRemark.edges.forEach(({ node }) => {
        createPage({
          path: node.frontmatter.path,
          component: blogPostTemplate,
          context: {}, // additional data can be passed via context
        });
      });
    });
  };
  
  exports.onCreateWebpackConfig = ({ stage, actions }) => {
    if (stage === "build-html") {
      actions.setWebpackConfig({
        module: {
          rules: [
            {
              test: path.resolve(
                __dirname,
                "node_modules/@kyma-project/react-components/lib/index.js",
              ),
              use: "null-loader",
            },
          ],
        },
      });
    }
  };
  