0

My react app (that I think is based of create-react-app - I didn't create it initially)

Doesn't use an index.html, it has an index.js, well it has a few index.js,

I want to know how this works? Basically when I run npm run build, a build folder isnt created, an es and a lib folder are created which are copies of the src folder (which contains the components)

Why are these two folders created and not a build?

I used an npm package: https://www.npmjs.com/package/react-chat-window

Here is my package.json (might hold the clues):

I really want to understand because on my server, I am using nginx, but it isnt routed to any of the files, the sites-available/default doesnt route to anywhere its the default settings so how does it work!?

{
  "name": "react-chat-window",
  "version": "1.0.8",
  "description": "react-live-chat React component",
  "main": "lib/index.js",
  "module": "es/index.js",
  "files": [
    "css",
    "es",
    "lib",
    "umd"
  ],
  "scripts": {
    "build": "nwb build-react-component --copy-files",
    "clean": "nwb clean-module && nwb clean-demo",
    "start": " nwb serve-react-demo",
    "gh:publish": "nwb build-demo && gh-pages -d demo/dist"
  },
  "dependencies": {
    "@material-ui/core": "^3.2.0",
    "emoji-js": "3.2.2",
    "fs": "0.0.1-security",
    "gh-pages": "^1.0.0",
    "material-ui": "^0.20.2",
    "moment": "^2.24.0",
    "prop-types": "15.5.10",
    "react-highlight.js": "1.0.5",
    "react-slick": "^0.23.2",
    "slick-carousel": "^1.8.1",
    "socket.io-client": "2.0.3"
  },
  "peerDependencies": {
    "react": "16.6.0",
    "react-dom": "^16.6.0"
  },
  "devDependencies": {
    "nwb": "0.17.x",
    "react": "^16.6.0",
    "react-dom": "^16.6.0"
  },
  "author": "",
  "homepage": "",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/kingofthestack/react-live-chat.git"
  },
  "keywords": [
    "react-component"
  ]
}
1
  • I've not used github pages myself but perhaps this holds the clue? As I can see gh-pages is in your package.json Commented Mar 21, 2019 at 22:13

1 Answer 1

1

you are not using create-react-app , you're using another boilerplate called nwb , here is his official documentation to understand how it works https://github.com/insin/nwb and here is his documentation concerning react https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb

Sign up to request clarification or add additional context in comments.

1 Comment

I think that was my problem I've been looking at create-react-app solutions! Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.