From 80396cbf41739275b43df20ef26e429a76bee11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 8 May 2020 16:27:15 +0200 Subject: [PATCH] fix(generator): avoid generating route with extension --- packages/generator/src/generator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/generator/src/generator.js b/packages/generator/src/generator.js index 1d78511fd2..a0e504f1ae 100644 --- a/packages/generator/src/generator.js +++ b/packages/generator/src/generator.js @@ -277,7 +277,7 @@ export default class Generator { parse(html).querySelectorAll('a').map((el) => { const href = (el.getAttribute('href') || '').split('?')[0].split('#')[0].trim() - if (href.startsWith('/') && this.shouldGenerateRoute(href) && !this.generatedRoutes.has(href)) { + if (href.startsWith('/') && !path.extname(href) && this.shouldGenerateRoute(href) && !this.generatedRoutes.has(href)) { this.generatedRoutes.add(href) // add the route to the tracked list this.routes.push({ route: href }) }