bud icon indicating copy to clipboard operation
bud copied to clipboard

[typescript] resolve .js extension when `type: "module"`

Open kellymears opened this issue 3 years ago • 0 comments

Description

When a user has {"type": "module"} set in package.json and is using typescript, we should resolve *.js imports to *.ts sources.

Context

From webpack v5.74.0 release:

  • add resolve.extensionAlias option which allows to alias extensions

This is useful when you are forced to add the .js extension to imports when the file really has a .ts extension (typescript + "type": "module")

Status

  • [ ] Add build.resolve.extensionAlias hook (Set<string>)
  • [ ] Check value of bud.context.manifest.type in:
    • [ ] @roots/bud-typescript
    • [ ] @roots/bud-swc
    • [ ] @roots/bud-esbuild
  • [ ] If value is module the hook should be called at the time the ruleset item is registered

kellymears avatar Sep 21 '22 04:09 kellymears