Open noshower opened 4 weeks ago
这个问题,在 1.0.x 中也是存在的
嘿,这个问题什么时候安排修复
You can try using this plugin code as a temporary fix for the issue.
class Plugin {
apply(compiler) {
compiler.hooks.afterCompile.tapPromise('delay', async () => {
await new Promise((r) => {
setTimeout(r, 10);
});
});
}
}
从提供的 demo 上看,因为 builtin:swc-loader 在转换代码时将 type.ts 的 import 给移除了导致 type.ts 没有被监听。目前可以直接把 type.ts 加入到 file_dependencies 中来解决。
From the provided demo, it seems that type.ts
is not monitored because builtin:swc-loader removes the import of type.ts
when converting the code. Currently, you can directly add type.ts
to file_dependencies
to solve this problem.
class MyPlugin {
apply(compiler) {
compiler.hooks.compilation.tap("MyPlugin", (compilation) => {
compilation.fileDependencies.add(path.resolve(__dirname, "./src/type.ts"))
})
}
}
System Info
Details
修改纯类型的文件时,rspack 没有编译,导致 tsconfig-paths-webpack-plugin 插件反应。
Reproduce link
No response
Reproduce Steps
下面是可复现的demo: rspack-project.zip
复现步骤
预期
终端中显示错误
实际
没有任何反应。
其他说明
在 0.5.6 版本中,不管是纯类型的 .d.ts 还是 .ts 文件,在保存文件后,都会触发类型检查。升级到 0.7.5 之后,纯类型文件,只会在首次启动时才参与类型检查,后面再修改,仿佛就没有修改似得。
另外我们从 webpack 迁移到 rspack ,项目架构没有变化,webpack 和 rspack@0.5.6 都是可以在文件修改后,触发类型检查。
期望,尽快修复这个问题,我们项目中每个组件都可能存在一个 type.ts(会被其他文件引用) 这样的纯类型文件和全局的 .d.ts(不会被其他文件引用,全局的) 文件。目前类型检查不工作,毕竟影响工作效率。
辛苦研发大哥们,早点修复。☕️