martinandert / babel-plugin-css-in-js

A plugin for Babel v6 which transforms inline styles defined in JavaScript modules into class names so they become available to, e.g. the `className` prop of React elements. While transforming, the plugin processes all JavaScript style definitions found and bundles them up into a CSS file, ready to be requested from your web server.
MIT License
298 stars 11 forks source link

Usage in a webpack dev environment #4

Closed Nimaear closed 8 years ago

Nimaear commented 8 years ago

I am wondering how one would go about setting a webpack dev environment up with this plugin? All my efforts have so far ended up with the styles of the last saved file overwriting the content of the bundled file.

martinandert commented 8 years ago

It's hard to tell what's wrong with your environment from far away. Your dev setup might be misconfigured. I'd like to take a look at it in order to understand what's going on.

Nimaear commented 8 years ago

I stripped down the project as much as I could (There might be some orphan islands left in) and is available at : [https://github.com/Nimaear/bare-example].

The not so stripped version is available at [https://github.com/Nimaear/react-isomorphic-template]

You should be able to see the problem after npm install && npm run dev

Nimaear commented 8 years ago

Created a pull request which solves the issue for me. Haven't encountered any problems so far.

tokenvolt commented 8 years ago

I'm having the same issue using webpack.

martinandert commented 8 years ago

I just released v1.2.2 with the referenced PR merged in.