()
| 144 | } |
| 145 | |
| 146 | function writeCrawlerFiles() { |
| 147 | const sitemapBody = buildRoutes() |
| 148 | .map( |
| 149 | ({ pathname, lastmod }) => |
| 150 | ` <url><loc>${escapeXml(buildCanonicalUrl(pathname))}</loc><lastmod>${escapeXml(lastmod)}</lastmod></url>` |
| 151 | ) |
| 152 | .join('\n'); |
| 153 | |
| 154 | fs.writeFileSync( |
| 155 | new URL('sitemap.xml', distRoot), |
| 156 | `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${sitemapBody}\n</urlset>\n` |
| 157 | ); |
| 158 | fs.writeFileSync(new URL('robots.txt', distRoot), `User-agent: *\nAllow: /\nSitemap: ${siteMetadata.siteUrl}sitemap.xml\n`); |
| 159 | } |
| 160 | |
| 161 | export default defineConfig(({ command }) => ({ |
| 162 | base: command === 'serve' ? '/' : '/oracle-database-code-samples/', |
no test coverage detected