unplugin-lightningcss
Lightning CSS integration for Vite, Rollup, esbuild, Webpack, Vue CLI, and more.
Last updated 2 years ago by sxzz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install unplugin-lightningcss 
SYNC missed versions from official npm registry.

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
<summary>Vite</summary>
// vite.config.ts
import LightningCSS from 'unplugin-lightningcss/vite'

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


<summary>Rollup</summary>

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()],
}


<summary>esbuild</summary>
// esbuild.config.js
import { build } from 'esbuild'

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


<summary>Webpack</summary>
// 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

Current Tags

  • 0.5.0                                ...           latest (4 months ago)

16 Versions

  • 0.5.0                                ...           4 months ago
  • 0.4.5                                ...           10 months ago
  • 0.4.4                                ...           a year ago
  • 0.4.3                                ...           a year ago
  • 0.4.2                                ...           a year ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Downloads
Total 50
Today 0
This Week 0
This Month 18
Last Day 0
Last Week 2
Last Month 32
Dependencies (4)
Dev Dependencies (17)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE