vercel/next.js / turbopack / crates / turbopack-lightningcss-napi / README.md
The React Framework
README.md
turbopack-lightningcss-napi
A vendored, lightly-modified port of the upstream lightningcss-napi crate
(the napi bindings glue that lives in the lightningcss repository under
node/, published to crates.io as lightningcss-napi).
Provenance
- Upstream crate:
lightningcss-napi0.4.6 (source:node/src/in the lightningcss repository; the workspace'slightningcssdependency is pinned to the matching1.0.0-alpha.70). - Vendored: July 2026, as part of the napi-rs v2 → v3 migration of the Next.js native bindings.
Why it is vendored
Upstream lightningcss-napi pins napi ^2 and cannot coexist with the napi
v3 bindings used by next-napi-bindings; a single Node.js addon must link
exactly one copy of the napi runtime. This crate is the upstream source
ported to the napi v3 API so the whole workspace can build against napi 3.x.
Local modifications relative to upstream 0.4.6
- Ported from napi v2 to the napi v3 API: lifetime-carrying
Object/Unknownvalue types,Function/FunctionRefinstead ofJsFunction, and the v3 reference/visitor plumbing intransformer.rs. This also fixed the JS visitor bridge, which silently no-op'd under a v3 runtime via the v2 compat path (breaking CSSurl()/@importrewriting and CSS-module handling). - The
bundle/bundleAsyncAPIs and the standalone cdylib/npm packaging were dropped; only thetransformandtransform_style_attributeentrypoints consumed bycrates/next-napi-bindings/src/css/mod.rsare kept, exposed as plain Rust functions rather than#[napi]exports. - No behavioral changes to CSS handling are intended. Upstream style-lint
violations are
#![allow(...)]-ed inlib.rsinstead of rewritten, to keep diffs against upstream small.
When to delete this crate
Delete this crate and depend on upstream again once lightningcss-napi
publishes a napi v3-compatible release (track
https://github.com/parcel-bundler/lightningcss/issues). When re-syncing
bug fixes in the meantime, diff against upstream node/src/ at 0.4.6.
Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.