donnikitos/vite-plugin-html-inject

data.replaceAll is not a function

HouDiZhong opened this issue · 1 comments

const replaceAttrMatcher = new RegExp("{=$}", "gi")
data = data.replaceAll(replaceAttrMatcher)
Regular is already a global mode,No need to use replaceAll,And replaceAll support is not good

Seems like that happens with NodeJS before version 15, due to not implemented .replaceAll() function.
Will use .replace() for broader support.