swc-project / swc-project/pkgs

Missing feature resolveFullPaths

Open
#60 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
86
Forks
44
Avg merge
3d 49m
Merged PRs (30d)
1

Description

I'm using swc to build a project that works with modules

{
// ...
"type": "module"
// ...
}

when I build using the swc cli it doesn't resolve all the paths and puts .js at the end

examples

import { database } from '#/database/drizzle'

should look like this when the build is complete

import { database } from './database/drizzle.js'

There should be an option to resolve fullpaths like this package implements.
Using this package you can use an argument that resolves all paths

https://www.npmjs.com/package/tsc-alias

// ...
  "tsc-alias": {
    "resolveFullPaths": true
  }
/// ....

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the SWC CLI path that rewrites module imports, using the reported TypeScript and JavaScript examples as the behavioral reference. Check how the CLI currently handles the #/database/drizzle alias and determine where an option like resolveFullPaths would belong. Done means the build emits a relative ./database/drizzle.js import for this case, with coverage for the option.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.