babel-plugin-transform-prejss
Babel plugin which turns PreJSS constructions into JSS objects.
Example
In
const button = preJSS` button { color: ; width: 200px; height: 70px; &:hover { text-decoration: underline; } }`
Out
var { var selector = _refselector; return 'button': { return propsdisabled ? 'grey' : 'red'; } 'width': '200px' 'height': '70px' '&:hover': 'textDecoration': 'underline' ;};
See more details here: https://github.com/axept/prejss
Installation
npm install babel-plugin-transform-prejss --save-dev
Usage
Options
-
removeImport: <Boolean|String>
- by default isprejss
. You can configure it tofalse
if you wouldn't like to remove imports for "prejss" automatically. But think twice! By disabling this option you may include server code and a lot of unnecessary dependencies into your bundle. -
silent: <Boolean>
- by default isfalse
. This option is configuring if the plugin should or not to log about each removed prejss import. -
namespace: <String>
- by default ispreJSS
.babelrc
(Recommended)
Via .babelrc
Via CLI
babel --plugins transform-prejss script.js
Via Node API
;