Skip to content

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

@xcatliu

Description

@xcatliu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleInactive issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions