fix(vite): npm resolution + cjs + duplicated preact signals (#3211)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import type { types } from "@babel/core";
|
||||
|
||||
export function jsxComments(): babel.PluginObj {
|
||||
return {
|
||||
name: "fresh-jsx-comment",
|
||||
visitor: {
|
||||
Program(path) {
|
||||
const comments = (path.parent as types.File).comments;
|
||||
if (comments) {
|
||||
for (let i = 0; i < comments.length; i++) {
|
||||
const comment = comments[i];
|
||||
|
||||
comment.value = comment.value.replaceAll(/@jsx\w+\s+[^\s*]+/g, "");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user