Build only what you need.
Choose the Reactive CSS capabilities your project uses. We’ll resolve the dependencies and generate the configuration for an optimized bundle.
Your bundle
Not built yet: the page generates the command, the CLI builds- Selected
- Nothing: the core alone
- Included
- core
| Bytes | This bundle | Standard | Difference |
|---|---|---|---|
| minified | 45,367 | 149,177 | −103,810 (70 %) |
| gzip | 16,908 | 49,278 | −32,370 (66 %) |
| brotli | 15,362 | 43,307 | −27,945 (65 %) |
Build it
@reactivecss/core 0.9.0 · CLI and API1 · Install
npm install --save-dev @reactivecss/core@0.9.0 esbuild2 · Build
npx -p @reactivecss/core -p esbuild reactive-css build --features core --out public/reactive-css.min.js3 · Load it
<script src="/reactive-css.min.js" defer></script>The same build through the API (Node script)
build-reactive-css.mjs
// build-reactive-css.mjs · run with: node build-reactive-css.mjs
import { build } from '@reactivecss/core/bundle';
const result = await build({
"features": [
"core"
],
"outfile": "public/reactive-css.min.js",
"format": "iife",
"minify": true
});
if (!result.ok) {
for (const e of result.errors) console.error(`${e.code}: ${e.message}`);
process.exit(1);
}
console.log(result.manifest.features.join(', '), result.manifest.sizes);Analyze my CSS
the library’s compiler, in this page · nothing is sentOnly the pasted text is analyzed. Stylesheets loaded or created at runtime, inline style attributes and sheets you did not paste are not seen; a missing feature then shows up in ReactiveCSS.diagnostics. When unsure, use the full runtime.
Or don’t build anything
The standard bundle has every feature and needs no tooling: start with it, and build a custom one when size matters. The compact bundle is the same full runtime with a shorter feature registry in describe(); it is not a feature selection.
| Bundle | min | gzip | brotli |
|---|---|---|---|
| reactive-css.min.js standard: every feature | 149,177 | 49,278 | 43,307 |
| reactive-css.compact.min.js every feature, compact describe() | 128,633 | 42,530 | 37,611 |