css-modules / css-modulesify

A browserify plugin to load CSS Modules
MIT License
403 stars 47 forks source link

build fails in 0.25.0 with react-dom #102

Closed pixelass closed 8 years ago

pixelass commented 8 years ago
import {nav} from './style.css'
import React, { Component, propTypes } from 'react'
//import ReactDOM from 'react-dom'
import { Router, Route } from 'react-enroute'
import {nav} from './style.css'
import React, { Component, propTypes } from 'react'
import ReactDOM from 'react-dom'
import { Router, Route } from 'react-enroute'
import ReactDOM from 'react-dom'

Using any command similar to this one I found in a demo

babelify -v -t [babelify --presets es2015 --presets react] -p [css-modulesify --after postcss-color-rebeccapurple --after autoprefixer --autoprefixer.browsers '> 5%' -o dist/main.css] -o dist/index.js src/index.js

The same issue occurs if I put the transforms in the package.json

{"browserify": {
    "transform": [
      "babelify",
      ["babelify", {
        "presets": ["es2015", "react", "stage-0"]
      }]
    ]
  }
}

Bug: (I think) the javascript is not fully generated (Browser console: Unexpected Input) and the css file is not generated

joshwnj commented 8 years ago

@pixelass thanks for reporting, from what I can see it looks like there was an issue with the stream not ending properly.

Could you please try upgrading to v0.25.1 and let me know if that fixes it?

pixelass commented 8 years ago

Seems to work fine. Thx