Skip to content

Inline local classNames into javascript #140

Closed
@ConradIrwin

Description

@ConradIrwin

Hey @sokra,

Right now I'm writing code like this:

var styles = require 'foo/bar.css'

module.exports = class Foo extends React.Component

  render: =>
    <div className={styles.foo}></div>

The problem is that when compiled and minified I still see the original names, and there's a module that exports: {"foo": "Xwvutsr123456"}. Is there a way we could pre-process the file so that styles.foo is inlined (as though we were using webpack.DefinePlugin)?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions