Skip to content

Commit

Permalink
fix(transform): fix transform (replace all <style> tags)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Aug 30, 2022
1 parent 960ecc9 commit bbefe85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const registerTransformPlugin = (nuxt: Nuxt, options: any) => {

function transformVueSFC (code: string, id: string) {
if (id.endsWith('.vue') && !id.includes('?')) {
const styleTagRe = /<style\b(.*?)\blang=['"][tj]sx?['"](.*?)>/
const styleTagRe = /<style\b(.*?)\blang=['"][tj]sx?['"](.*?)>/g
if (code.match(styleTagRe)) {
return code.replace(styleTagRe, '<style$1lang="postcss"$2>')
}
Expand Down

0 comments on commit bbefe85

Please sign in to comment.