无法使用XAMPP部署React项目。

问题描述 投票:0回答:1

我怎样才能建立我的项目,使我可以把它放在我想放的地方?例如,如果可以的话,我很想在上看到它。XAMPP?

每当我建立我的反应应用程序。索引.html 是空的。

这里是GitHub上的整个项目。https:/github.comslabysreacty.git。

每当我使用 npm run build,我的文件夹 构建 是与所有内容一起创建的。

Build structureFull app structure

index.html 从构建。https:/pastebin.comWSyAvrwu。

软件包.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": {}
}
reactjs deployment
1个回答
1
投票

问题解决了!

所有的工作都很好。只是当我有这个项目 buildXAMPP htdocs,我把它放到一个文件夹里。因此,在将文件从文件夹中移到 正下方 localhost EVERYTHING开始工作。

© www.soinside.com 2019 - 2024. All rights reserved.