2.7b1 Rslib打包Bundleless时的文件名问题
原创2025/10/18小于 1 分钟
背景
在使用Rslib进行Bundleless打包的过程中,遇到了如下错误
warn Duplicate entry components\VfToggleSwitch\src\ToggleSwitch from src\components\VfToggleSwitch\src\ToggleSwitch.vue and src\components\VfToggleSwitch\src\ToggleSwitch.ts, which may lead to the incorrect output, please rename the file.发生了什么
rslib在处理components\VfToggleSwitch\src\这个目录时,发现了两个文件:
ToggleSwitch.vueToggleSwitch.ts
虽然这两个文件的拓展名不同,但是他们最终都会尝试生成一个js模块,二者的文件名就冲突了
解决办法
Note
警告信息其实已经给出了方法 please rename the file
重命名文件
例如:
ToggleSwitch.vue保留ToggleSwitch.ts-->ToggleSwitch.type.ts
链接到当前文件 0
没有文件链接到当前文件
