feat(compiler): add oxc builder#3446
Open
GNURub wants to merge 1 commit into
Open
Conversation
|
Using the default NestJS template, I have the following error on build with oxc : The same code works with tsc, swc and rspack (on v12). Compiling with oxc creates a runtime dependency on @oxc-project/runtime for the decorators support. It would be a nice addition to have a log during watch mode reload, similar to how it was implemented on the rspack version in https://github.com/nestjs/nest-cli/blob/v12.0.0/lib/compiler/rspack-compiler.ts#L134 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Nest CLI currently supports
tsc,swc, andwebpackas builder options.There is no OXC-based builder available, so users cannot compile projects through
oxc-transformusingnest buildornest start.Issue Number: N/A
What is the new behavior?
This PR adds an experimental
oxcbuilder powered byoxc-transform.The new builder supports:
nest build --builder oxcnest start --builder oxc.ts,.tsx,.mts, and.ctscompilation.mts -> .mjsand.cts -> .cjsIt also adds builder validation support for
oxcin the build and start commands,plus unit test coverage for the new compiler behavior and command integration.
The implementation uses
oxc-transform@0.89.0conservatively to avoid raising thecurrent Node.js engine requirement.
Does this PR introduce a breaking change?
This is additive. Existing builders and configuration continue to work as before.
Other information
Validation performed:
npm run buildnpm test -- --runInBand --no-watchmannpx tsc --noEmitgit diff --check