heroku部署过程中缺少图像

时间:2018-04-06 04:50:06

标签: heroku webpack buildpack

我尝试使用webpack部署react应用程序 我使用了create-react-app-buildpack https://github.com/mars/create-react-app-buildpack

我有static.json

{
  "root": "public/",
  "routes":{
    "/**": "index.html"
  }
}

我设置NPM_CONFIG_PRODUCTION = true NODE_ENV =生产YARN_PRODUCTION = true  但是我得到了这个错误 好像它无法访问那些图像

ERROR in ./src/Shared/Header/Header.jsx
Module not found: Error: Can't resolve '../../assets/images/logos/logo-white.png' in '/tmp/build_abbb8ced25af1dcc8cb901be4bc3d3e9/src/Shared/Header'
 @ ./src/Shared/Header/Header.jsx 2:0-60
 @ ./src/HomePage/HomePage.jsx
 @ ./src/HomePage/index.js
 @ ./src/App/App.jsx
 @ ./src/App/index.js
 @ ./src/index.jsx
 @ multi core-js/fn/promise core-js/es6/object core-js/es6/array ./src/index.jsx
ERROR in ./src/LoginPage/LoginPage.jsx
Module not found: Error: Can't resolve '../assets/images/logos/logo-orange.png' in '/tmp/build_abbb8ced25af1dcc8cb901be4bc3d3e9/src/LoginPage'
 @ ./src/LoginPage/LoginPage.jsx 10:0-58
 @ ./src/LoginPage/index.js
 @ ./src/App/App.jsx
 @ ./src/App/index.js
 @ ./src/index.jsx
 @ multi core-js/fn/promise core-js/es6/object core-js/es6/array ./src/index.jsx
ERROR in ./src/SignUpPage/SignUpPage.jsx
Module not found: Error: Can't resolve '../assets/images/logos/logo-orange.png' in '/tmp/build_abbb8ced25af1dcc8cb901be4bc3d3e9/src/SignUpPage'
 @ ./src/SignUpPage/SignUpPage.jsx 7:0-58
 @ ./src/SignUpPage/index.js
 @ ./src/App/App.jsx
 @ ./src/App/index.js
 @ ./src/index.jsx
 @ multi core-js/fn/promise core-js/es6/object core-js/es6/array ./src/index.jsx
Child html-webpack-plugin for "index.html":

任何想法如何解决?

1 个答案:

答案 0 :(得分:0)

我创建了这个问题它与区分大小写有关,并通过引用地址修正来修复