question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relative paths in build output

See original GitHub issue

Currently in the built index html, the js & css paths are absolute:

<script type="text/javascript" src="/main.bb7fdae8a3a384b182b2.js">

Is there a way to make them relative? I would like to host the app in a path below root.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:29
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

21reactions
vgrigoriucommented, Jul 28, 2016

I had to set homepage to ./ to get relative paths. I don’t know if it’s ‘right’ but it works for me, so thanks!

11reactions
Timercommented, Feb 11, 2017

Hi there! react-scripts v0.9.0 was just released which adds support for building for relative paths. You may read how to do so here.

Please test it and don’t hesitate to reach out if this doesn’t solve your specific use case!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make relative paths from build output clickable in the terminal
If a relative path within the terminal starts from the root directory, you can click on it and open the corresponding file.
Read more >
reactjs - Relative path in index.html after build - Stack Overflow
When I use "." or "./" I can see that all the paths now have a dot at the beginning, but it seems...
Read more >
Paths explained: Absolute, relative, UNC, and URL—Help
A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a...
Read more >
Relative and Absolute Paths
All paths default to relative when first entered. This allows you to move the project folder and the paths in the properties will...
Read more >
Relative path for Build Output Directory - VI Package Manager ...
I try to build a package by calling a LabView executable that is using the VIMP API. I need to set a relative...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found