React.js-Create-react-app-based file root path modification after packaging

Source: Internet
Author: User

react projects built with Create-react-app scaffolding the package files generated after using NPM run build can only be accessed at the root directory The server directory is not accessible.

the error is:

Manually changing the path of the index.html and then reporting the static resource introduction error

Put

Switch

The error is:

The workaround is simple:

Locate the MyApp directory Config folder under Paths.js

Around 37 lines (this is the profile produced in the new React project in 2017-12-23)

Modify to the following code

function==| |  (Publicurl url.parse (publicurl). Pathname: './');  returntrue);

function Circle is modify path

END

React.js-Create-react-app-based file root path modification after packaging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.