1

How can I build my project so I can put it wherever I want? For example, I would love to see it on, if it's possible, XAMPP?

Whenever I build my react app, index.html is empty.

Here is the whole project on GitHub: https://github.com/slabys/reacty.git

Whenever I use npm run build, my folder build is created with all the content:

Build structure Full app structure

index.html from build: https://pastebin.com/WSyAvrwu

package.json

    {
  "name": "my_react",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@stardust-ui/docs-components": "^0.40.0",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "bootstrap": "^4.5.0",
    "browser-sync": "^2.26.7",
    "del": "^5.1.0",
    "express": "^4.17.1",
    "express-favicon": "^2.0.1",
    "gulp-autoprefixer": "^7.0.1",
    "gulp-concat": "^2.6.1",
    "gulp-copy": "^4.0.1",
    "gulp-data": "^1.3.1",
    "gulp-plumber": "^1.2.1",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-twig": "^1.2.0",
    "prettier": "^1.4.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "react-sidebar": "^3.0.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
  "main": "index.js",
  "devDependencies": {
    "@craco/craco": "^5.6.4",
    "@semantic-ui-react/craco-less": "^1.2.1",
    "gulp": "^4.0.2",
    "gulp-sass": "^4.1.0",
    "node-sass": "^4.14.1",
    "semantic-ui-less": "^2.4.1"
  },
  "author": "slabys",
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "react"
  },
  "optionalDependencies": {}
}
Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
Šimon Slabý
  • 533
  • 1
  • 4
  • 18
  • You can deploy react app using xampp or any other web sever. Check [deployment](https://create-react-app.dev/docs/deployment/) and [this answer](https://stackoverflow.com/a/53816284/2873538) – Ajeet Shah May 30 '20 at 14:51
  • Yeah index.html is not totally empty, but it still did not contain all the things I did... basically its only white page. So if I'm gonna take "build" folder and I'm gonna move it into XAMPP htdocs all I'am gonna see is white page. – Šimon Slabý May 30 '20 at 17:54

1 Answers1

1

Problem solved!

All works fine. Just when I have this projects build in XAMPP htdocs, I put in into a folder. So after moving files from folder directly under localhost EVERYTHING started to work.

Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
Šimon Slabý
  • 533
  • 1
  • 4
  • 18