Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build output doesn't work locally by default (href <link> are absolute) #248

Open
Stijn-B opened this issue Jul 26, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Stijn-B
Copy link

Stijn-B commented Jul 26, 2022

The href attribute of <link> tags is an absolute url like href=/path/to/file. As a result those files aren't loaded when opening the build result (public/index.html) locally during development. This is fixed by making the urls relative like href=./path/to/file.

I don't know if making the urls relative during building would lead to unwanted effects in production. If not, it might be a nice quality of life improvent; you can check locally whether your build output behaves as expected.
(Personally, when opening the build output, at first I thought I did something wrong because the css styling didn't load but it was just this detail)

@eight04
Copy link
Contributor

eight04 commented Nov 4, 2022

If you use Elderjs/template, try the serve command:
https://github.com/Elderjs/template/blob/8d3ba83efa9c14e70fc69cb4c30d9d0c42ca8483/package.json#L12

IIRC, path logic are located everywhere so this feature may require some refactoring.

@eight04 eight04 added the enhancement New feature or request label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants