lightningcss-linux-x64-gnu is a platform-specific native Node.js binding for Lightning CSS, an extremely fast CSS parser, transformer, bundler, and minifier written in Rust. It serves as the underlying native module for Linux x64 GNU systems when using the main `lightningcss` npm package. Lightning CSS, currently at version 1.32.0 and released frequently (typically minor versions every few weeks), is known for its exceptional performance, often outperforming JavaScript-based tools by over 100x. Key differentiators include its Rust foundation, browser-grade parsing based on Mozilla's `cssparser` and `selectors` crates, advanced minification techniques (shorthands, merging rules, reducing `calc()` expressions), automatic vendor prefixing, syntax lowering for modern CSS features (like nesting, custom media, high gamut colors) based on `browserslist` targets, and robust support for CSS Modules with local scoping and tree-shaking capabilities. [1, 2, 8, 10, 11]
npm install lightningcss-linux-x64-gnuVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the `transform` function to minify CSS, apply vendor prefixes, lower syntax (like `oklab` colors and nesting) for specified browser targets, and generate a source map. This example shows processing modern CSS features like nesting and custom media queries. [2, 8, 10, 11]
Review relative color calculations; update percentage values to numbers where applicable according to the latest CSS Color Module Level 5 specification. Consult `lightningcss` documentation for specific examples.
Always install the umbrella `lightningcss` package (`npm install lightningcss`) and let it manage the appropriate native bindings for your target environment. Only install specific bindings directly for advanced, platform-constrained deployment scenarios.
Ensure your project is configured for ES Modules (e.g., `"type": "module"` in `package.json`, using `.mjs` extensions) and use `import` statements. If a CJS environment is strictly required, investigate dynamic `import()` or dual-package strategies, though direct `require()` is generally not supported for ESM-only packages. [14]
Minimize the complexity and frequency of JS visitor calls. Optimize visitor logic for performance. Consider if the custom transform can be achieved through configuration options or if the performance impact is acceptable for your build process.
Migrate your project or the offending file to use ES Modules by adding `"type": "module"` to your `package.json` or changing the file extension to `.mjs`. Then, update `require()` calls to `import` statements (e.g., `import { transform } from 'lightningcss';`).Convert your CSS string to a Node.js `Buffer` before passing it to the `code` option. Example: `code: Buffer.from(yourCssString)`. For browser/Deno environments using `lightningcss-wasm`, use `new TextEncoder().encode(yourCssString)`.
Ensure you have a `browserslist` entry in your `package.json` or `.browserslistrc` file. Alternatively, explicitly pass the `targets` option to `transform` or `bundle` with appropriate browser versions (e.g., `targets: { chrome: 100 << 16 }` for Chrome 100).No dependency data recorded yet.