A loader for webpack that transforms CSS to JavaScript object.
Install
npm install -D css-inline-loader
Usage
webpack.config.js:
moduleexports = module: loaders: test: /\.css$/ loaders: 'css-inline'
example.css:
example.js
var styles = console // -> { // foo: { // backgroundColor: '#FF0000' // } // } Component return <div =></div>
Options
?camelCase
Convert key from any format to camel case.
webpack.config.js:
moduleexports = module: loaders: test: /\.css$/ loaders: 'css-inline?camelCase'
example.css:
example.js
var styles = console // -> { // fooBar: { // backgroundColor: '#FF0000' // } // } Component return <div =></div>