You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . transformScopedCss = void 0 ;
const tags _1 = require ( "./tags" ) ;
const logs _1 = require ( "../logs" ) ;
function transformScopedCss ( cssCode ) {
checkHtmlTagSelector ( cssCode ) ;
return cssCode . replace ( /\[(data-v-[a-f0-9]{8})\]/gi , ( _ , scopedId ) => {
return '.' + scopedId ;
} ) ;
}
exports . transformScopedCss = transformScopedCss ;
function checkHtmlTagSelector ( cssCode ) {
for ( const tag in tags _1 . HTML _TO _MINI _PROGRAM _TAGS ) {
if ( new RegExp ( ` ( | \n | \t |,|}) ${ tag } ( *)(,|{) ` , 'g' ) . test ( cssCode ) ) {
( 0 , logs _1 . output ) ( 'warn' , ` 小程序端 style 暂不支持 ${ tag } 标签选择器,推荐使用 class 选择器, 详情参考: https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#style ` ) ;
break ;
}
}
}