Skip to content

bduffany/rules_lightningcss

Repository files navigation

rules_lightningcss

Bazel rules for https://github.com/parcel-bundler/lightningcss, an extremely fast CSS parser, transformer, and minifier written in Rust.

Project status

This project is being developed, and does not yet have an official release. For now, feel free to click "Watch" on GitHub to be notified when it is released.

Features

Core functionality:

  • CSS modules: module-scoped class names (composes is not supported)
  • browserslist
  • Minification
  • Source maps
  • Compiling multiple sources (--output-dir)
  • Dependencies and bundling: @import, composes (CSS modules), custom resolvers
  • Custom transforms

Supporting functionality:

  • JS class map generation
    • Given a file like MyComponent.module.css, generates MyComponent.module.css.js containing a map with classes that can be imported and referenced from JS or TS code.
    • This is done using a small, fast tool written in C++ that parses the JSON output from lightningcss and directly generates a JS file.

Usage

See examples directory.

TODO: publish to Bazel Central Registry.

About

Bazel rules for lightningcss

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published