Skip to content

Latest commit

 

History

History
97 lines (70 loc) · 1.96 KB

README.md

File metadata and controls

97 lines (70 loc) · 1.96 KB

unplugin-lightningcss npm 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')()],
}


Example

import { Features } from 'lightningcss'

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

Sponsors

License

MIT License © 2023-PRESENT 三咲智子