⚡ perf(build): migrate compilation from tsc/babel to SWC#210
⚡ perf(build): migrate compilation from tsc/babel to SWC#210
Conversation
- Upgrade @swc/core ~1.5.7 → ~1.15.18, @swc/cli, @swc/helpers, @swc-node/register - Migrate 21 packages from @nx/js:tsc to @nx/js:swc with per-package .swcrc - Replace ts-loader with swc-loader in apps/api webpack config - Replace babel-jest with @swc/jest for packages/ui tests - Remove unused tslib from all package dependencies - Remove babel-jest and packages/ui/.babelrc - Set babel: false in nx.json generators Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e-builds Override the global @nx/esbuild:esbuild dependsOn with an empty array so esbuild bundles directly from source via tsconfig paths, skipping 14 sequential SWC package builds that were redundant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR replaces the monorepo's TypeScript compilation pipeline from Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before - tsc and babel"]
S1[TypeScript Source] -->|ts-loader| W1[Webpack Bundle API]
S2[Package Sources] -->|nx:tsc executor| D1[dist/packages]
S3[packages/ui tests] -->|babel-jest| J1[Jest Output]
D1 -->|dependsOn build| M1[MCP Server Build]
end
subgraph After["After - SWC"]
S4[TypeScript Source] -->|swc-loader| W2[Webpack Bundle API]
S4 -->|ForkTsCheckerPlugin| TC[Type Check]
S5[Package Sources] -->|nx:swc executor + .swcrc| D2[dist/packages]
S6[packages/ui tests] -->|swc-jest| J2[Jest Output]
S7[MCP Server Source] -->|esbuild bundle=true| M2[MCP Server Build]
TP[tsconfig paths to src] -.->|resolves source directly| M2
end
style Before fill:#fff3cd
style After fill:#d4edda
|
Delete packages/ui/.babelrc (no consumers after SWC migration) and remove @babel/core, @babel/preset-env, @babel/preset-react, @babel/preset-typescript from root devDependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|



Explanation
Migrate the monorepo's TypeScript compilation pipeline from tsc/babel to SWC, and optimize the MCP server Docker startup by removing redundant dependency pre-builds.
Type of Change
Affected Components
packages/andtools/packmind-pluginWhat Changed
1. SWC migration (
b4b055c5)tscandbabelcompilation with@swc/cli/@swc/coreacross all packages.swcrcconfiguration files to each package with appropriate settings (decorators, dynamic imports, CommonJS output)project.jsonto use@nx/js:swcexecutor instead of@nx/js:tsc@babel/core,@babel/preset-env,babel-plugin-transform-vite-meta-envand.babelrcfrompackages/uipackages/ui/jest.config.tsto use@swc/jesttransformerapps/api/webpack.config.jsto useswc-loaderinstead ofts-loaderpackage.jsondevDependencies accordingly2. MCP server Docker startup optimization (
516dba76)@nx/esbuild:esbuilddependsOnwith an empty array inapps/mcp-server/project.jsonTesting
Test Details:
packages/ui/jest.config.tsto use@swc/jestas transformerTODO List
Reviewer Notes
.swcrcfile to handle package-specific settings (e.g., decorator metadata, dynamic imports)nx.jsonglobaltargetDefaultsfor@nx/js:swcreplaces the previous@nx/js:tscdefaults🤖 Generated with Claude Code