Repro
https://github.com/jim-king-2000/nextbugrepro
Detail
Я создаю очень простой компонент реагирования.
const My = () => (<div>ABC</div>);
export default My;
Он находится в отдельном проекте библиотеки(https://github.com/jim-king-2000/react-module).
Теперь я использую компонент в другом проекте.
// index.js
import { My } from 'react-module';
// package.json
"dependencies": {
...
"react-module": "git+https://github.com/jim-king-2000/react-module.git"
}
Затем, node.js жалуется:
error in ./node_modules/react-module/components/My.js
Module parse failed: Unexpected token (1:18)
You may need an appropriate loader to handle this file type.
const My = () => (<div>ABC</div>);
export default My;
./node_modules/react-module/index.js 1:0-32 1:0-32
@ ./pages/index.js
@ multi ./pages/index.js
Вопрос
Как построить ES6 реагировать на библиотеку npm?