[FIX] tools: allow to pre-compile templates with - in their name

Compiling a template with a dash ("-") in its name generates an
invalid function name in the compiled code.

A template named `"my-component"` leads to the function
`function my-component(app, bdom, helpers) { ... }` which has an
invalid name.

closes #1333
This commit is contained in:
Lucas Lefèvre
2023-01-24 14:12:29 +01:00
committed by Sam Degueldre
parent b2685b6709
commit 8702db03fb
+1 -1
View File
@@ -48,7 +48,7 @@ function writeToFile(filepath, data) {
}
// adapted from https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
const a = "·_,:;";
const a = -_,:;";
const p = new RegExp(a.split("").join("|"), "g");
function slugify(str) {