Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 2.9 kB view raw
1import * as os from 'os'; 2import { resolve } from 'path'; 3import constants from './src/constants'; 4import Document from './src/html'; 5 6const basePath = 7 process.env.VERCEL_ENV === 'preview' ? '.' : 'open-source/urql'; 8const isStaging = process.env.REACT_STATIC_ENV === 'staging'; 9const isProduction = process.env.REACT_STATIC_ENV === 'production'; 10 11export default { 12 plugins: [ 13 resolve(__dirname, 'plugins/assets-fix/'), 14 resolve(__dirname, 'plugins/monorepo-fix/'), 15 resolve(__dirname, 'plugins/react-router/'), 16 (isStaging || isProduction) && resolve(__dirname, 'plugins/preact/'), 17 [ 18 'react-static-plugin-md-pages', 19 { 20 location: '../../docs', 21 template: './src/screens/docs', 22 pathPrefix: 'docs', 23 }, 24 ], 25 26 'react-static-plugin-styled-components', 27 'react-static-plugin-sitemap', 28 ].filter(Boolean), 29 30 paths: { 31 src: 'src', 32 dist: `dist/${basePath}`, 33 buildArtifacts: 'node_modules/.cache/react-static/artifacts/', 34 devDist: 'node_modules/.cache/react-static/dist/', 35 temp: 'node_modules/.cache/react-static/temp/', 36 assetsPath: 'static', 37 public: 'public', // The public directory (files copied to dist during build) 38 }, 39 40 basePath, 41 stagingBasePath: basePath, 42 devBasePath: basePath, 43 44 Document, 45 46 getSiteData: () => ({ 47 title: constants.docsTitle, 48 }), 49 50 maxThreads: Math.min(8, os.cpus().length / 2), 51 52 getRoutes: async () => [ 53 { 54 path: '/', 55 template: require.resolve('./src/screens/home'), 56 }, 57 { 58 path: '/docs/concepts/core-package', 59 redirect: '/docs/basics/core', 60 }, 61 { 62 path: '/docs/basics/getting-started', 63 redirect: '/docs/basics', 64 }, 65 { 66 path: '/docs/basics/mutations', 67 redirect: '/docs/basics', 68 }, 69 { 70 path: '/docs/basics/queries', 71 redirect: '/docs/basics', 72 }, 73 { 74 path: '404', 75 template: require.resolve('./src/screens/404'), 76 }, 77 { 78 path: '/docs/graphcache/custom-updates', 79 redirect: '/docs/graphcache/cache-updates', 80 }, 81 { 82 path: '/docs/graphcache/computed-queries', 83 redirect: '/docs/graphcache/local-resolvers', 84 }, 85 { 86 path: '/docs/graphcache/under-the-hood', 87 redirect: '/docs/graphcache/normalized-caching', 88 }, 89 { 90 path: '/docs/concepts/document-caching', 91 redirect: '/docs/basics/document-caching', 92 }, 93 { 94 path: '/docs/concepts/errors', 95 redirect: '/docs/basics/errors', 96 }, 97 { 98 path: '/docs/concepts', 99 redirect: '/docs/architecture', 100 }, 101 { 102 path: '/docs/concepts/stream-patterns', 103 redirect: '/docs/architecture', 104 }, 105 { 106 path: '/docs/concepts/philosophy', 107 redirect: '/docs/architecture', 108 }, 109 { 110 path: '/docs/concepts/exchanges', 111 redirect: '/docs/advanced/authoring-exchanges', 112 }, 113 ], 114};