I've been using an open source website to host a domain.
The original github project is using symfony to build the project.
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
I noticed that when deploying to IPFS, the index.html was using absolute pathing:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link rel="icon" type="image/png" href="/build/images/fav.png" />
<link rel="stylesheet" href="/build/main.css">
<script src="/build/main.js"></script>
</head>
<body>
<main>
<img id="logo" src="/build/images/logo.png" alt="Logo" />
<div id="minting-dapp"></div>
</main>
<div id="notifications"></div>
</body>
</html>
So I deleted the index.html file and decided to use rebuild the project, but I noticed that encore, does not build the index.html file ever.
I would like my index.html file to update using with the build.
How can I configure it to use the homepage
variable to use relative pathing similar to how npm build works see this answer for reference
Encore does not build any html files, it generates files for js and css such as vendor files, runtime, ...
You can directly specify it in the code :
<body>
<main>
<img id="logo" src="{{ asset('/images/logo.png')}}" alt="Logo" />
<div id="minting-dapp"></div>
</main>
<div id="notifications"></div>
</body>
And then it will not use the absolute path -> Check Asset Component