Open lukemurray opened 3 weeks ago
Hello @lukemurray, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction
will be closed if no activities in 14 days.
System Info
System: OS: macOS 15.1 CPU: (10) arm64 Apple M1 Max Memory: 3.81 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.17.0 - /opt/homebrew/opt/node@20/bin/node npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm Browsers: Chrome: 130.0.6723.92 Safari: 18.1
Details
Hi, I'm looking at moving from webpack to rsbuild which uses Rspack.
Everything is working so except our type generation. We use GraphQL and we use Apollo client to generate Typescript types for the queries etc.
With webpack we used
compiler.hooks.make.tap
to just call theapollo client:codegen
command to generate the types. This worked fine.Bringing things over to rsbuild/pack we have a Rspack plugin that does the same hook. The hook is called and the types are generated. However when fork-ts-checker-webpack-plugin runs it is like it only has the old generated type files as they were when the process started. If we restart the
npx rsbuild dev
process it will pick up the new type changes.I can confirm that the types are being generated, I can change a query and open the generated file to see the change. VS Code picks the change up and correctly reports on any issues. Just rspack seems to have some cache of the file from the start of running the process.
Any ideas?
Reproduce link
No response
Reproduce Steps
Run
npx rsbuild dev
With this plugin
regenerateTypes
will call Apollo, but basically it generates.ts
files which we import in our components.