Migrating the existing react app from "create-react-app" to "parcel"

98 Views Asked by At

I have a react project on which I've used create-react-app and now I have come to know about the advantages of using parcel so now I want to use the parcel for building the rest of the project.

I installed parcel as dev dependency and started the server, It says that index.html is not reachable for that I added the start script "start": "parcel ./src/index.html" but now its giving another error

Server running at http://localhost:1234

 Build failed.

@parcel/core: Failed to resolve '%PUBLIC_URL%/logo.svg' from './public/index.html'

@parcel/resolver-default: Cannot load file './%PUBLIC_URL%/logo.svg' in './public'.

This is the GitHub repo: https://github.com/olifarhaan/griha-milan

This is the live link just in case you want to check: https://griha-milan.vercel.app/

I tried adding /logo.svg instead of ./%PUBLIC_URL%/logo.svg . Also, I'm using the env variable in the index.html for the title and description. I am not able to figure out how to show the environment variable there.

1

There are 1 best solutions below

0
Greg Fenton On

If this were me, I'd create a brand new parcel project, then copy src and other assets into the new project. Copy the .git over as well, then you have a clone of your existing repository but in a new parcel project. Avoid bringing over any CRA-related elements.