mjohnston / react-native-webpack-server

Build React Native apps with Webpack
MIT License
933 stars 84 forks source link

Use of ES6 syntax in webpack config #119

Closed niftylettuce closed 8 years ago

niftylettuce commented 8 years ago

It doesn't parse! It gives error, e.g.:

import path from 'path';
^^^^^^

SyntaxError: Unexpected reserved word
elliottsj commented 8 years ago

If you want to use import statements (and a bunch of other ES6 features) in node you'll need to use babel-node: npm install babel, then:

./node_modules/.bin/babel-node ./node_modules/.bin/rnws start
niftylettuce commented 8 years ago

Didn't know this! Thanks! On Oct 31, 2015 1:11 AM, "Spencer Elliott" notifications@github.com wrote:

If you want to use import statements (and a bunch of other ES6 features) in node you'll need to use babel-node: npm install babel, then:

./node_modules/.bin/babel-node ./node_modules/.bin/rnws start

— Reply to this email directly or view it on GitHub https://github.com/mjohnston/react-native-webpack-server/issues/119#issuecomment-152696582 .