/
githubmirror
/
vuetify
Обзор
Документация
Войти
/
githubmirror
/
vuetify
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/docs/build/sitemap.js
33 строки
802 B
Kael
Merge branch 'dev' into next
15 ноя 2021, 19:16
15 ноя 2021, 19:16
6d9e382
Код
Авторство
О чём код?
const SitemapWebpackPlugin = require('sitemap-webpack-plugin').default const { generateRoutes } = require('./generate-routes') class SitemapPlugin { apply (compiler) { const routes = generateRoutes() const paths = [] for (const route of routes) { let priority = 0.5 if (route.fullPath === '/') priority = 1.0 else if (route.fullPath.includes('/components')) priority = 0.8 else if (route.fullPath.includes('/api')) priority = 0.7 paths.push({ path: route.fullPath, lastmod: new Date().toISOString(), priority, changefreq: 'daily', }) } const plugin = new SitemapWebpackPlugin({ base: 'https://vuetifyjs.com', paths, }) plugin.apply(compiler) } } module.exports = new SitemapPlugin()