Registry / web-framework / lightningcss-win32-x64-msvc

lightningcss-win32-x64-msvc

JSON →
library1.32.0jsnpmunverified

lightningcss-win32-x64-msvc is a specific native binary package for Lightning CSS, compiled for `x86_64` Windows environments using the MSVC toolchain. It provides the high-performance CSS parsing, transformation, and minification capabilities of Lightning CSS, which is primarily written in Rust. End-users typically interact with the primary `lightningcss` npm package, which automatically selects and loads the appropriate platform-specific binding, such as this one. The core Lightning CSS library is currently at version 1.32.0 and maintains an active release cadence with frequent minor and patch updates, offering comprehensive support for modern CSS features like nesting, container queries, custom properties, and CSS Modules. Its primary differentiators are its Rust-based performance, deep integration with browser compatibility data for targeted transpilation, and advanced bundling features. It serves as a fast alternative to tools like PostCSS.

npm install lightningcss-win32-x64-msvc
INSTALL
IMPORT
SIG · LIGHTNINGCSS-WIN32
L
lightningcss-win32-x64-msvc
web-frameworkjavascriptv1.32.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transform
import { transform } from 'lightningcss';
const { transform } = require('lightningcss');
Users import from the main `lightningcss` package, not directly from `lightningcss-win32-x64-msvc`. CommonJS `require` is also supported.
bundle
import { bundle } from 'lightningcss';
import bundle from 'lightningcss/bundle';
The `bundle` function is for processing `@import` rules and is a named export from the main `lightningcss` package.
CustomError
import { CustomError } from 'lightningcss';
Various error types (e.g., `CustomError`) are also named exports for handling specific parsing or transformation issues.

This example demonstrates how to use the `transform` function from `lightningcss` to minify CSS, add vendor prefixes based on target browsers, generate source maps, and enable experimental draft features like nesting and container queries. It writes the input CSS to a temporary file and outputs the processed CSS and its source map.

import { transform } from 'lightningcss'; import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; import { join } from 'path'; const inputCSSContent = ` :root { --primary-color: #3498db; } .container { display: flex; align-items: center; justify-content: center; background-color: var(--primary-color); } .button { appearance: none; -webkit-appearance: none; background: linear-gradient(to right, red, blue); transform: scale(1.1); animation: fadeIn 1s ease-in-out; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @container (min-width: 400px) { .container { padding: 20px; } } `; const inputFilename = 'input.css'; const outputFilename = 'output.min.css'; const outputDir = join(__dirname, 'dist'); const inputPath = join(outputDir, inputFilename); const outputPath = join(outputDir, outputFilename); if (!existsSync(outputDir)) { mkdirSync(outputDir, { recursive: true }); } writeFileSync(inputPath, inputCSSContent); try { const { code, map } = transform({ filename: inputFilename, code: Buffer.from(inputCSSContent), minify: true, targets: { chrome: 1000000, // Chrome 100 firefox: 1000000, // Firefox 100 safari: 150000, // Safari 15 }, sourceMap: true, drafts: { nesting: true, // Enable CSS Nesting draft customMedia: true, // Enable Custom Media Queries draft scope: true // Enable CSS Scope draft } }); console.log('Transformed and minified CSS:'); console.log(code.toString()); writeFileSync(outputPath, code.toString()); if (map) { console.log('\nGenerated Source Map:'); console.log(map.toString()); writeFileSync(`${outputPath}.map`, map.toString()); } console.log(`\nSuccessfully processed CSS. Output saved to: ${outputPath}`); } catch (error: any) { console.error('Error processing CSS with Lightning CSS:', error.message); }
Debug
Known issues
gotchaThis package (`lightningcss-win32-x64-msvc`) is a native binary binding for a specific platform (Windows x64 with MSVC). End-users should typically install the main `lightningcss` npm package, which automatically detects the environment and installs the correct platform-specific native module.
fix
Install `lightningcss` directly: `npm install lightningcss`. Avoid installing platform-specific packages unless explicitly managing native dependencies.
affects: >=1.0.0
breakingIn v1.30.0, the parsing of relative colors was updated to align with the latest CSS Working Group specification. Colors now support numbers in addition to percentages, and `calc()` expressions within colors are always interpreted as numbers. This was a technical breaking change in the spec itself.
fix
Review any existing CSS code using relative color calculations, especially those involving percentages. You may need to update them to use numbers where appropriate to match the new spec behavior.
affects: >=1.30.0
gotchaWhile `lightningcss` is primarily written in Rust for performance, its JavaScript API uses Node.js native modules. This means that build tools (like MSVC on Windows, or `gcc`/`clang` on Unix-like systems) are sometimes required during `npm install` for compilation if prebuilt binaries are unavailable or incompatible with your specific environment.
fix
Ensure you have the necessary build tools installed for your operating system (e.g., Python 3 and Visual Studio Build Tools for Windows, or `build-essential` for Linux). Node-gyp errors during installation often indicate missing build toolchains.
affects: >=1.0.0
breakingThe behavior of CSS nesting was updated in v1.30.0 to reflect changes in the spec. It is now possible to nest selectors with pseudo elements more flexibly, and rules for mixed declarations and nested rules have evolved.
fix
Familiarize yourself with the latest CSS nesting specification and adjust your nested CSS accordingly. Existing valid nesting syntax should generally continue to work, but new possibilities are available.
affects: >=1.30.0
Errors
Common errors & fixes
Error: Cannot find module 'lightningcss-win32-x64-msvc/lightningcss.node' or its corresponding type declarations.
The native module for Lightning CSS could not be loaded. This often happens if the `lightningcss` package was installed incorrectly, the wrong platform-specific binary was chosen, or required build tools were missing during installation.
fix
First, delete `node_modules` and `package-lock.json` (or `yarn.lock`). Then, reinstall the main `lightningcss` package: `npm install lightningcss`. If problems persist, ensure your system has the necessary build tools (e.g., Python 3 and Visual Studio Build Tools for Windows).
Error: Expected '(', found ':'
This is a common parsing error indicating a CSS syntax mistake, often related to invalid use of pseudo-elements or selectors where a function is expected.
fix
Review the problematic CSS snippet indicated by the error message. Ensure all parentheses, colons, and other syntax elements are correctly placed according to CSS specifications.
Error: BrowserslistError: Unknown browser 'chrome 1000000'
The `targets` option passed to `transform` or `bundle` uses an invalid browser or version string, or the version is extremely high and not recognized by the underlying `browserslist` data.
fix
Correct the browser target string to a valid format, e.g., `{ chrome: 100 }` for Chrome 100. Ensure the version number is realistic and follows `browserslist` conventions (e.g., `1000000` is usually interpreted as `100.0.0` or simply `100`).
Upgrade
Version history
1.32.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
lightningcss-win32-x64-msvc — npm install lightningcss-win32-x64-msvc · libregistry