Socket
Book a DemoInstallSign in
Socket

unplugin-lightningcss

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-lightningcss

Lightning CSS integration for Vite, Rollup, esbuild, Webpack, Vue CLI, and more.

latest
Source
npmnpm
Version
0.4.3
Version published
Weekly downloads
6.5K
-16.72%
Maintainers
4
Weekly downloads
 
Created
Source

unplugin-lightningcss

npm version npm downloads JSR Unit Test

Lightning CSS integration for Vite, Rollup, esbuild, Webpack, Vue CLI, and more.

Installation

npm i -D unplugin-lightningcss
Vite
// vite.config.ts
import LightningCSS from 'unplugin-lightningcss/vite'

export default defineConfig({
  plugins: [LightningCSS()],
})


Rollup

Since Rollup does not support CSS out of the box, you need to use a CSS plugin like rollup-plugin-css-only.

// rollup.config.js
import css from 'rollup-plugin-css-only'
import LightningCSS from 'unplugin-lightningcss/rollup'

export default {
  plugins: [LightningCSS(), css()],
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [require('unplugin-lightningcss/esbuild')()],
})


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require('unplugin-lightningcss/webpack')()],
}


Options

import { Features } from 'lightningcss'

export default {
  plugins: [
    LightningCSS({
      options: {
        include: Features.Nesting,
      },

      /**
       * Whether to export the transformed CSS as a default string export.
       * @default false
       */
      asString: false,
    }),
  ],
}

Sponsors

License

MIT License © 2023-PRESENT Kevin Deng

Keywords

unplugin

FAQs

Package last updated on 12 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts