parcel icon indicating copy to clipboard operation
parcel copied to clipboard

Is there a way to build html with relative assets url?

Open xcatliu opened this issue 6 years ago • 39 comments

Choose one: is this a 🐛 bug report or 🙋 feature request?

🙋 feature request

🤔 Expected Behavior

When exec parcel build docs/index.html, the generated html should have relative assets url, such as:

<script src="./89ee6b6452b6649c72b85a19637b8362.js"></script>

😯 Current Behavior

The url is an absolute path:

<script src="/dist/89ee6b6452b6649c72b85a19637b8362.js"></script>

💁 Possible Solution

Is there a way to build html with relative assets url? Maybe some configuration?

🔦 Context

A common practice is to only host the dist (or public) dir using a static server. But with absolute path, it cannot find the assets resource.

xcatliu avatar Dec 11 '17 11:12 xcatliu