跪拜 Guibai
← All articles
Frontend · JavaScript · NestJS

NestJS 12 Goes Full ESM, npm 12 Breaks Lifecycle Scripts, and a Startup Charges $10k to Delete AI Code

By 晓得迷路了 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

npm 12's silent suppression of lifecycle scripts will break CI pipelines and install hooks that teams rely on for post-install setup. NestJS 12's ESM-only shift forces the same module-system reckoning that has been rippling through the Node ecosystem, and the Rspack swap cuts build times for one of the most widely used backend frameworks.

Summary

NestJS 12 ships with a full ESM migration across all core packages, Rspack replacing Webpack in the CLI, and Vitest becoming the default test runner. The CLI now handles both CommonJS and ESM projects during the transition. Astro 7.1 lands with support for running multiple dev servers in parallel, a feature aimed squarely at AI agent workflows, alongside memory optimizations for content collections.

npm 12 arrives as a stable release with a hard break: lifecycle scripts no longer execute automatically. The npm team recommends upgrading to 11.18.0 first as a stepping stone. On the tooling side, TanStack released an npm download chart that visualizes package popularity trends over time, and Mozilla's web-ext hit 10.5 for cross-platform browser extension development.

A startup called Slopfix is charging $10,000 per week to delete AI-generated code. In one engagement, they cut a 100,000-line codebase down to 35,000 lines while preserving functionality — a blunt signal that the volume of AI-authored code now creates its own maintenance burden.

Takeaways
NestJS 12 migrates all core packages from CommonJS to ESM and replaces Webpack with Rspack in the CLI.
The NestJS CLI now supports both CommonJS and ESM projects, and the default test runner moves to Vitest.
Astro 7.1 can launch multiple dev servers simultaneously, targeting AI agent use cases, and reduces content collection memory usage.
npm 12 stops running lifecycle scripts by default — a breaking change; the team suggests upgrading to 11.18.0 first.
TanStack's new npm stats tool charts long-term download trends for any package.
web-ext 10.5 provides a maintained, cross-platform CLI for building browser extensions.
react-dropzone 17.0 offers React Hook-based, HTML-standard file drag-and-drop zones.
Slopfix, a three-engineer startup, charges $10,000/week to delete AI-generated code and once reduced a 100k-line codebase to 35k lines.
Conclusions

npm 12's lifecycle-script change is the kind of breaking shift that looks small in a changelog but will silently corrupt installs across thousands of projects that depend on postinstall hooks for native bindings or code generation.

NestJS adopting Rspack over Webpack is a milestone for Rust-based bundlers in the enterprise Node space — it signals that the performance argument has won even in conservative, long-cycle frameworks.

Slopfix's business model is less a gimmick and more a leading indicator: AI code generation has shifted the bottleneck from writing code to deleting the surplus it produces.

Concepts & terms
ESM (ECMAScript Modules)
The official standard module system for JavaScript, using import and export syntax. It runs natively in modern browsers and Node.js, replacing the older CommonJS require() system.
Rspack
A high-performance JavaScript bundler written in Rust, designed as a drop-in replacement for Webpack with significantly faster build times and a compatible configuration API.
Lifecycle scripts (npm)
Scripts defined in package.json (like postinstall or prestart) that npm automatically executes at specific points during package installation or publishing. npm 12 disables this automatic execution by default.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗