Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Set relative path folder in Svelte Build

$
0
0

Set relative path folder in Svelte build

When I build my svelte app with the command npm run build, it's export the links like this:

<script type="module" crossorigin src="/assets/index-54c7d896.js"></script><link rel="stylesheet" href="/assets/index-d3d038e5.css">

More accurately it call to the root localhost/assets...

    // src="/assets/index-54c7d896.js"    // href="/assets/index-d3d038e5.css"

And I get this:

Error from the navigator

From here:

where I want use the svelte app

And easy solution is using a relative path to:

// from "/assets/..." to "./assets/..."src="./assets/index-54c7d896.js"href="./assets/index-d3d038e5.css"

But the thing is I can't do that inside javascript and css files.These still use an absolute path.

So this is what happens:
when a css file call other files using absolute path

I mean I could dig into a compiled file but it's not efficient

I tried change manually the paths on each file but it's a lot of work each time than I have to compile.

I'm using a hosting with php so I tried using .htaccess but it's hard too.

I am expecting this to be configurable from svelte.

I really love ❤️ this framework, thanks in advance for your help.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>