Commit Graph

15 Commits

Author SHA1 Message Date
Victor Freitas
74e3d0466a
fix(es/module): Fix jsc.paths using absolute paths with dots in a filename for an alias (#9595)
**Description:**

- Resolves `jsc.paths` using an absolute filename with dots

**Related issue:**

- Closes https://github.com/swc-project/swc/issues/9591
2024-10-01 11:12:26 +09:00
Donny/강동윤
a417ff4d86
feat(allocator): Add maybe types (#9278) 2024-07-19 13:22:34 +09:00
yehonatanz
e22c3681a6
fix(es/resolver): Prioritze jsc.paths by length in tsc resolver (#8875)
**Description:**

See #8858 

**BREAKING CHANGE:**
`jsc.paths` are now prioritized differently to align with `tsc`. The order is:
1. Exact matches
2. Wildcard pattern matches, sorted by length of prefix before wildcard


**Related issue:**

 - Closes #8858
2024-04-19 13:38:19 +00:00
Donny/강동윤
4961bb055d
fix(es/module): Fix jsc.paths with resolveFully (#8784)
**Related issue:**

 - Closes #8782
2024-03-28 02:42:07 +00:00
Donny/강동윤
761365eb56
fix(es/module): Allow FileName::Anon from node resolver (#8686)
**Related issue:**
 
 - Closes #8674
2024-03-04 09:36:17 +00:00
xiao xin
d6a4615898
fix(es/loader): Make tsc resolver work for bare specifier (#8550)
**Description:**

From the typescript
[baseUrl](https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl)
doc: When using bare specifiers (module specifiers that don’t begin with
./, ../, or /), baseUrl has a higher precedence than node_modules
package lookups.

In the current tsc resolver implementation, when resolving bare module
specifiers, baseUrl was not used except for `paths`, this cause the
belowing resolution failed, but it worked when used in typescript
project.

`tsconfig.json` / `.swcrc`:
```json
{
    baseUrl: "."
    paths: {
        "@common/*": ["src/common/*"]
    }
}
```

File structure:
- ./src/common/helper.ts
- ./src/index.ts


./src/index.ts content:
```ts
 // tsc can resolve this, but tsc resolver cannot
import sth from "src/common/helper"
```
2024-01-27 04:56:11 +00:00
Donny/강동윤
71fb5c12a7
fix(es/module): Fix resolving of dependencies (#8533)
**Description:**

I changed the signature of `Resolve` because there was a need to pass the `value` part from `jsc.paths` to the caller.


**Related issue:**

 - Closes #8184
2024-01-21 21:35:57 +09:00
Donny/강동윤
d33a97303c
fix(es/module): Make jsc.paths work for a nest.js app (#7852) 2023-08-25 15:05:43 +09:00
Robin Appelman
beefdd459c
fix(es/loader): Fix browser overwrites not applying correctly (#7243) 2023-04-14 23:48:22 +00:00
Daiki Nishikawa
6b7249dcde
feat(es/loader): Support node: prefix from NodeModulesResolver (#6868) 2023-01-29 15:31:13 +00:00
Donny/강동윤
a6d404a8c2
chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00
Donny/강동윤
8886a4b572
fix(es/minifier): Respect dead_code (#4328) 2022-04-14 06:00:43 +00:00
Julien Karst
780de7095e
fix(es/loader): Fix traversal of node modules resolver (#4327) 2022-04-13 19:51:17 +00:00
Donny/강동윤
9b76783281
refactor(common): Cleanup & rustfmt (#3495)
swc_common:
 - Merge identical source codes.

swc_css_parser:
 - Deny `clippy::all`.
 - Fix lints.
2022-02-09 06:33:32 +00:00
Donny/강동윤
2b2f6955f2
refactor: Flatten ecmascript (#2708) 2021-11-10 19:00:54 +09:00