create-react-app and lite-server

733 views Asked by At

So I working using ftp and so I can't use their npm start which is only localhost. I'm trying to run create-react-app with lite-server but am unsure of how to configure it so I can access the correct folder.

I've tried soft linking the build folder, but all there is, is a blank page with console errors.

This is my bs-config.js file

module.exports = 
{
    "files": ["./build/*.{html, htm, css, js}"],
    "server": { "baseDir": "./" }
}

So when I first run the lite-server I get a 200 GET / then a 304 GET /index.html However I then get the three errors:

404 GET /reactjs/build/static/js/main.9c645ba0.js
404 GET /reactjs/build/static/css/main.9a0fe4f1.css
404 GET /reactjs/build/static/js/main.9c645ba0.js

The files are obviously there, but I'm not sure how to configure lite-server to read those files properly.

1

There are 1 answers

0
Paul Alexeev On

you need next setting for react project which created with create-react-app for example:

  module.exports = {
    "port": 3000,  
    "notify": false, 
    "ui": false, 
    "files":  "*.none", 
    "server": { "baseDir": "./build" }
   };