尝试使用yarn导入react-image-crop包并将其添加到react boilerplate。
安装程序包后出现此错误
Module parse failed: /Users/...../frontend/node_modules/react-image-crop/lib/ReactCrop.js Unexpected token (62:25)
You may need an appropriate loader to handle this file type.
|
| function makeAspectCrop(crop, imageAspect) {
| const completeCrop = { ...crop };
|
| if (crop.width) {
@ ./app/components/ImageUpload/index.js 23:0-41
@ ./app/containers/HomePage/index.js
@ ./app/containers/HomePage/Loadable.js
@ ./app/containers/App/index.js
@ ./app/app.js
@ multi eventsource-polyfill webpa样板使用的是babylons env预设,因此扩展操作符应该可用。
你知道原因是什么吗?
发布于 2018-01-17 04:48:01
我没有直接从react-image-crop导入,而是使用
import ReactCrop from 'react-image-crop/dist/ReactCrop';像个护身符一样工作
https://stackoverflow.com/questions/48288731
复制相似问题