Babel plugin for treat, a CSS-in-JS library that compiles out all runtime style definitions to static CSS files at build time. Version 1.6.2 is the latest, with treat itself at v2.x. The plugin is required for Babel-based setups (alternative to treat webpack loader). Key differentiator: treat is build-time only, unlike runtime CSS-in-JS libraries. The plugin handles extraction of themed styles and local scope. Active maintenance, integrated into treat monorepo.
npm install babel-plugin-treatVerified import paths — ran on the pinned version, not inferred.
Shows minimal Babel config to enable treat plugin with optional theming.
Update theme export to match treat v2 format (e.g., use createTheme or treatTheme).
Upgrade to Babel 7.
Place 'babel-plugin-treat' early in plugins array, typically before React or module transform plugins.
Use 'makeStyles' from 'treat' directly; remove 'createThemedStyles' imports.
Use ["babel-plugin-treat", {}] array syntax in the plugins list.Run 'npm install --save-dev babel-plugin-treat' (or yarn add).
Use the plugin in Babel config only; do not import 'babel-plugin-treat' in source code.