images are not displaying after adding homepage in package.json of react js app

Viewed 226

in order to deploy react app on the tomcat server I added homepage in the react app package.json.but after that images disappears from the react page.for image storage i have new folder image folder in the public folder and saved all my images there..and using the path to fetch images '/images/image1.jpg'

here is package.json

{
  "name": "reactapp",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://localhost:8080/bunge",
  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.15.3",
    "@testing-library/jest-dom": "^5.11.10",
    "@testing-library/react": "^11.2.6",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.21.1",
    "bootstrap": "^4.6.0",
    "bootstrap-icons": "^1.4.1",
    "font-awesome": "^4.7.0",
    "react": "^17.0.2",
    "react-bootstrap": "^1.5.2",
    "react-dom": "^17.0.2",
    "react-redux": "^7.2.3",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.3",
    "react-thunk": "^1.0.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "web-vitals": "^1.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}


0 Answers
Related