text: import axios from 'axios'
  import path from 'path'
  
  // Paths Aliases defined through tsconfig.json
  const typescriptWebpackPaths = require('./webpack.config.js')
  
  export default {
    entry: path.join(__dirname, 'src', 'index.tsx'),
    getSiteData: () => ({
      title: 'React Static',
    }),
    getRoutes: async () => {
      const { data: posts } = await axios.get('https://jsonplaceholder.typicode.com/posts')
      return [
        {
          path: '/',
          component: 'src/containers/Home',
        },
        {
          path: '/about',
          component: 'src/containers/About',
        },
        {
          path: '/blog',
          component: 'src/containers/Blog',
          getData: () => ({
            posts,
          }),
          children: posts.map(post => ({
            path: `/post/${post.id}`,
            component: 'src/containers/Post',
            getData: () => ({
              post,
            }),
          })),
        },
        {
          path: '404',
          component: 'src/containers/404',
        },
      ]
    },
    webpack: (config, { defaultLoaders }) => {
      // Add .ts and .tsx extension to resolver
      config.resolve.extensions.push('.ts', '.tsx')
  
      // Add TypeScript Path Mappings (from tsconfig via webpack.config.js)
      // to react-statics alias resolution
      config.resolve.alias = typescriptWebpackPaths.resolve.alias
  
      // We replace the existing JS rule with one, that allows us to use
      // both TypeScript and JavaScript interchangeably
      config.module.rules = [
        {
          oneOf: [
            {
              test: /\.(js|jsx|ts|tsx)$/,
              exclude: defaultLoaders.jsLoader.exclude, // as std jsLoader exclude
              use: [
                {
                  loader: 'babel-loader',
                },
                {
                  loader: require.resolve('ts-loader'),
                  options: {
                    transpileOnly: true,
                  },
                },
              ],
            },
            defaultLoaders.cssLoader,
            defaultLoaders.fileLoader,
          ],
        },
      ]
      return config
    },
  }
  