babel-plugin-inline-classnames
Babel plugin which inlines the result of classnames
Useful for production builds.
Install
npm:
npm install -S babel-plugin-inline-classnames
yarn:
yarn add babel-plugin-inline-classnames
Usage
Add this plugin to your Babel config. Most commonly used in .babelrc
:
For all environments:
For production only (see env option):
Examples
Input:
;; ;;;;;;;;;
Output:
; 'foo bar';'foo bar';'foo-bar';'';'foo bar';'foo bar';'foo bar baz quux';'bar ' + 1;stylesfoo || '' + ' ' + stylesbar || '';
With bind
:
;; const cx = classNames; ;
Output:
; stylesfoo || '' + ' ' + stylesbar || '';
Versions
See full changelog for details.
1.*
- requires Babel6.*
2.*
- requires Babel7.*