File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export default async function TsLoader(content) {
45
45
} ;
46
46
}
47
47
48
+ // TODO: 考虑改成从项目目录内的 tsconfig.json 读取配置
48
49
const tsResult = ts . transpileModule ( `${ content } ` , {
49
50
compilerOptions : {
50
51
target : ts . ScriptTarget . ESNext ,
@@ -58,7 +59,12 @@ export default async function TsLoader(content) {
58
59
const assets = ( await Promise . all ( modules ) ) . filter (
59
60
( m ) => m ?. metadata ?. type === "asset"
60
61
) ;
61
- await loader . generateModule ( loader . resourcePath , ( ) => tsResult . outputText ) ;
62
+ await loader . generateModule ( loader . resourcePath , ( ) =>
63
+ tsResult . outputText . replace (
64
+ "react/jsx-runtime" ,
65
+ "@lcui/react/lib/jsx-runtime.js"
66
+ )
67
+ ) ;
62
68
const { default : componentFunc } = await loader . importModule (
63
69
loader . resourcePath
64
70
) ;
You can’t perform that action at this time.
0 commit comments