HenrikJoreteg / hjs-webpack

Helpers/presets for setting up webpack with hotloading react and ES6(2015) using Babel.
1.79k stars 127 forks source link

webpack compile error #210

Closed marlonfan closed 8 years ago

marlonfan commented 8 years ago

my js file ext is 'jsx'

import React from 'react'

class MyApp extends React.Component {
    render () {
        return <div />;
    }
}

React.render(<MyApp />,
    document.body)

if i use babel-loader version is 6.*, i see webpack compile error is:

Module build failed: SyntaxError: /Users/marlon/code/freetime/src/app.jsx: Unexpected token (5:15)
   3 | class MyApp extends React.Component {
   4 |     render () {
> 5 |         return <h1>Wonderful App</h1>
      |                ^
   6 |     }
   7 | }
   8 |

but if i use bable-loader version is 5.*, it compile is successfully

marlonfan commented 8 years ago

sorry, i added .babelrc file is done.