Shai UI
Shai UI

Reputation: 51968

Create react app, build with relative directories

In my CRA when I do an "npm run build" it creates a bundle file index.html that has links that look like:

link href="/static/css/main.ef6ca77b.css"

But I don't want it to refer to absolute directories. I'd like for it to use relative directories like:

link href="static/css/main.ef6ca77b.css"

(so without that initial slash...)

Is this possible? The reason I'm asking is I'm deploying multiple apps to a directory and they need refer to their resources relatively and not absolutely...

Upvotes: 0

Views: 869

Answers (1)

Shai UI
Shai UI

Reputation: 51968

Had to add:

 "homepage": "./"

to package.json

Upvotes: 2

Related Questions