fix: prefix double quote

This commit is contained in:
zernonia 2024-06-19 10:48:23 +08:00
parent 6d36be6440
commit d6460cd236

View File

@ -59,7 +59,7 @@ export function transformTwPrefix(opts: TransformOpts): CodemodPlugin {
// handle class attribute without binding // handle class attribute without binding
else if (node.type === 'VLiteral' && typeof node.value === 'string') { else if (node.type === 'VLiteral' && typeof node.value === 'string') {
if (node.parent.key.name === 'class') { if (node.parent.key.name === 'class') {
node.value = `"${applyPrefix(node.value, config.tailwind.prefix)}"` node.value = `"${applyPrefix(node.value.replace(/"/g, ''), config.tailwind.prefix)}"`
transformCount++ transformCount++
} }
} }