swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.78k stars 75 forks source link

fix: support compile js files. close #761 #767

Closed yeliex closed 5 months ago

yeliex commented 5 months ago

Currently swc-register only transpile .tsx? files. But @swc/core supports both .js and .ts files. It is necessary to transpile both file types to align behavior with @swc/core because of features like path alias and others in some cases.

Additionally:

  1. because of https://github.com/swc-project/swc/pull/8784 we should update @swc/core to the latest version. So this should be a minor semver
  2. update node esm module hook API definition to node:module

close #761

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: c47505b07b68213b02a1876e04b5a8d01cdedc09

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

socket-security[bot] commented 5 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@swc/core@1.3.107

View full report↗︎

yeliex commented 5 months ago

@Brooooooklyn @stelescuraul please take a look.

It changed some behavior but should be compatible with old versions.

yeliex commented 5 months ago

769 #765 could be closed as well @Brooooooklyn