-
-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Version
windows 10;
Chrome;
@rslib/core 0.1.3;Details
- tsconfig.json配置如下:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsxFactory": "h",
"rootDir": "src",
"isolatedModules":true,
"declaration": true
},
"include": ["src"]
}
- 项目中使用vue2以及jsx编写组件,使用pluginVue2、pluginVue2Jsx对文件进行编译,编译后的文件使用了
React.createElement而不是h函数 rslib.config.ts配置:
import { defineConfig } from "@rslib/core";
import { pluginSass } from "@rsbuild/plugin-sass";
import { pluginVue2 } from "@rsbuild/plugin-vue2";
import { pluginVue2Jsx } from "@rsbuild/plugin-vue2-jsx";
export default defineConfig({
plugins: [pluginSass(),pluginVue2(),pluginVue2Jsx()],
lib: [
{
source: {
entry: {
index: "./src/**",
},
},
format: "cjs",
bundle: false,
autoExternal:false,
dts: { bundle: false, distPath: "./lib", build: false, abortOnError: false },
//dts:false
}
],
output: {
target: "web",
distPath: {
root: "./lib",
},
}
});编译后的结果:
Reproduce link
https://github.com/NexxLuo/rslib-demo.git
Reproduce Steps
- yarn install
- npm run build
- 查看packages/packages-a/lib/ComponentA.js,文件中错误使用了
React.createElement
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working

