lc-test3 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/p.js +8 -6
- package/package.json +1 -1
package/p.js
CHANGED
|
@@ -42,14 +42,16 @@ const swcParserConfig = {
|
|
|
42
42
|
dynamicImport: true,
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const permissionCommentPattern = /\/\*\*[\s\S]*?RESOURCESTREE-START[\s\S]*?RESOURCESTREE-END[\s\S]*?\*\//g;
|
|
46
46
|
|
|
47
47
|
function sanitizePermissionCommentsForJSX(code: string) {
|
|
48
|
-
return code.replace(
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
return code.replace(permissionCommentPattern, (comment, offset) => {
|
|
49
|
+
const rest = code.slice(offset + comment.length);
|
|
50
|
+
// SWC �� "return (/**...*/<JSX" �Ľ������ȶ���ֱ���Ƴ�������� JSX ��ʼ��ǩ��Ȩ��ע��
|
|
51
|
+
if (/^\s*</.test(rest)) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
return comment;
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
|