fix: use _ as word boundary in IIFE var names

This commit is contained in:
FabianLars
2024-08-07 14:03:10 +02:00
parent 901dd560be
commit 396ed3fa56
8 changed files with 199 additions and 6 deletions
+4 -1
View File
@@ -32,7 +32,10 @@ export function createConfig(options = {}) {
const pluginJsName = pkg.name
.replace("@tauri-apps/plugin-", "")
.replace(/-./g, (x) => x[1].toUpperCase());
const iifeVarName = `__TAURI_PLUGIN_${pluginJsName.toUpperCase()}__`;
const iifeVarName = `__TAURI_PLUGIN_${pkg.name
.replace("@tauri-apps/plugin-", "")
.replace("-", (x) => "_")
.toUpperCase()}__`;
return [
{