Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

How to handle the npm packages wrote with Es6? #138

Closed
Creemli opened this issue Aug 2, 2016 · 2 comments
Closed

How to handle the npm packages wrote with Es6? #138

Creemli opened this issue Aug 2, 2016 · 2 comments

Comments

@Creemli
Copy link

Creemli commented Aug 2, 2016

When I trying to convert an existing project to web, it turns out to be the error:

index.js:3Uncaught SyntaxError: Unexpected token import

and this file is in the /node_modules/ directory. (I found many react-native packages are wrote with es6)

@brainpoint
Copy link
Contributor

同问, 使用node v6来处理都会出错

@flyskywhy
Copy link
Contributor

flyskywhy commented Sep 18, 2016

@Creemli @brainpoint , this issue was resolved in latest github.com/taobaofed/react-web.git , with the change of webpack.config.js (exclude: [/node_modules/] to exclude: /(node_modules\/(?!react))/) in #145 , you can directly use react-native packages wroted with es6 e.g. react-native-scrollable-tab-view

You can

react-web init <ExistedProjectDir>

and then

cd <ExistedProjectDir>
npm install --save git+https://github.com/taobaofed/react-web.git 

now, or when @yuanyan publish a newer(>0.0.3) react-web-cli on npm or yourself manually modify global installed react-web-cli/index.js ref to PR #154 , you can just

react-web init --version git+https://github.com/taobaofed/react-web.git

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants