aspect-build / aspect-build/rules_swc
[Bug]: `module.resolveFully` cannot work with remote execution
- Dominant language
- Starlark
- Stars
- 49
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
Running the `swc` transpiler through `ts_project` with `module.resolveFully` set to true in `.swcrc` leads to different outputs when remote execution is enabled than when running locally.
This is due to only passing the file to transpile as input to the swc_action, and not the other source files / transpiled files from dependencies.
### Version
bazel: 9.0.0
aspect_rules_ts: 3.8.6
aspect_rules_swc: 2.6.2
Os: Linux x86_64
### How to reproduce
```shell
Have a `.ts` file import a file from a directory with an index file, set resolveFully to true in .swcrc.
main.ts:
import { something } from "./folder";
console.log(something);
folder/index.ts:
const something: string = "something";
export { something };
Without remote execution:
main.js:
import { something } from "./folder/index.js";
console.log(something);
With remote execution:
main.js:
import { something } from "./folder";
console.log(something);
```
### Any other information?
This case is a bit tricky to handle, as a fix might impact performance.
Contributor guide
Research direction
Reproduce the difference with main.ts, folder/index.ts, ts_project, and resolveFully in .swcrc. Inspect the swc_action inputs and how dependency source or transpiled files are supplied during remote execution. Done means remote and local builds produce the same fully resolved import while accounting for the reported performance concern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100