Closed MOSapeizer closed 2 years ago
https://github.com/frandiox/vite-ssr/blob/43baabedee697fcf4c83e0f8ee6d0d42dd9c96a1/src/utils/html.ts#L40-L51
const template = '<div id="app"></div>' const state = { productName: 'buy me, only $1' } template.replace(/<div id="app"([\s\w\-"'=[\]]*)><\/div>/, `<div>${state.productName || "'{}'"}<\/div>`) // expect: // '<div>buy me, only $1</div>' // result: // '<div>buy me, only </div>'
I discovered this issue around the same time, but I also pinpointed that around version 0.13.0 is where this bug appears (since rolling back to 0.12.x fixes it)
Code Ref
https://github.com/frandiox/vite-ssr/blob/43baabedee697fcf4c83e0f8ee6d0d42dd9c96a1/src/utils/html.ts#L40-L51
demo