From 0a00387688923fc0cfacbd70c335c664d8d04cc0 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 13 Mar 2024 14:43:20 +0100 Subject: [PATCH] fix(templates): handle `-` in regexp --- src/templates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates.ts b/src/templates.ts index 808e8858..794fc6b4 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -56,7 +56,7 @@ export default function createTemplates (options: ModuleOptions, nuxt: Nuxt) { let json = JSON.stringify(result, null, 2) for (const variant of variants) { - json = json.replaceAll(new RegExp(`("${variant}": "[0-9a-z]+")`, 'g'), '$1 as const') + json = json.replaceAll(new RegExp(`("${variant}": "[0-9a-z-]+")`, 'g'), '$1 as const') } return `export default ${json}`