1.30.2
React Compiler support
Crafty now supports the React Compiler through SWC, working across all three SWC-backed bundlers (webpack, Rspack, and Gulp) (#3230).
It is off by default and opt-in per bundle:
{
bundles: {
app: {
react: { reactCompiler: true }
}
}
}Passing true uses the compiler defaults; passing an object forwards options such as target (for React 17/18) and compilationMode. It is independent of Fast Refresh and runs in both development and production. Rspack requires @rspack/core ≥ 2.1.0. See the crafty-preset-react README for details.
TypeScript path mapping
TypeScript's compilerOptions.paths / baseUrl aliases are now honored during actual module resolution, not just by the type-checker and the ESLint import resolver (#3231).
Path mapping now works across webpack, Rspack, Jest, and Vitest, all backed by the same enhanced-resolve tsconfig engine for identical semantics. The Gulp runner is intentionally not supported, because tsc keeps import specifiers as written when it emits files one by one; this is documented as a limitation.
Bug fixes
- Fixed several Vitest integration problems in mixed projects using
crafty-preset-babel,crafty-preset-typescript, andcrafty-preset-vitesttogether (#3178):- Babel could incorrectly take over
.ts/.tsxtest files and fail them with parse errors. The Babel Vitest plugin is now limited to JavaScript files. - JSX tests could fail when importing a relative TypeScript helper, because Babel converted the import to CommonJS and bypassed Vitest's TypeScript-aware resolution. ESM modules are now kept in the Babel Vitest hook.
- Crafty's bundled source-map support could misdetect DOM environments (
happy-dom,jsdom) as browsers and trigger localhost requests, surfacing asECONNREFUSED,GET http://localhost/.../*.ts 404, or jsdomNetworkErrornoise. Crafty now installssource-map-supportwith an explicit Node environment. Production webpack source maps are unaffected.
- Babel could incorrectly take over
Internal
- Yarn upgraded to 4.15.0.
- CI actions bumped:
actions/checkoutto v7,actions/setup-nodeto v6,actions/setup-javato v5.5.0.
Tool updates
- ESLint: 10.4.1 → 10.6.0
- typescript-eslint: 8.61.0 → 8.63.0
- Rspack: 2.0.6 → 2.1.2
- Vitest: 4.1.8 → 4.1.10
- SWC: 1.15.40 → 1.15.43
- postcss: 8.5.15 → 8.5.16
- browserslist: 4.28.2 → 4.28.5
- enhanced-resolve: 5.23.0 → 5.24.2
- @vercel/ncc: 0.38.4 → 0.44.1
Thanks for the bug reports and contributions
Thanks to @AndreySushkovich for the Vitest/Babel/TypeScript integration fixes.