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

Trunk generates relative urls for (at least) css resources #78

Closed
ranile opened this issue Oct 10, 2020 · 3 comments · Fixed by #79
Closed

Trunk generates relative urls for (at least) css resources #78

ranile opened this issue Oct 10, 2020 · 3 comments · Fixed by #79
Assignees
Labels
bug Something isn't working

Comments

@ranile
Copy link
Contributor

ranile commented Oct 10, 2020

<head>
    <base data-trunk-public-url />
    <!--Some elements omitted for simplicity-->
    <link data-trunk href="styles/styles.scss" rel="scss">
</head>

This head of index.html is converted to

<head>
    <base href="/">
    <!--Some elements omitted for simplicity-->
    <link rel="stylesheet" href="styles-c779a680004c93da.css">
<script type="module">import init from '/index-d59ae4335718e745.js';init('/index-d59ae4335718e745_bg.wasm');</script></head>

Here, the link for stylesheet has a relative url but js and wasm files have absolute urls. The URL for stylesheet should also be absolute (with maybe an option to make it relative? I don't see where that would be needed though.)

@thedodd
Copy link
Member

thedodd commented Oct 10, 2020

Hmm, yea ... they should definitely be absolute. And actually, they should include the public-url as the base if one is provided, which is what the WASM pipeline does. Will fix this and push it as 0.7.2.

thedodd added a commit that referenced this issue Oct 10, 2020
This ensures that all generated assets — CSS, SASS/SCSS, icons &c — are
all properly rooted to the configured `public-url`, which defaults to
`/`.

closes #78
@thedodd
Copy link
Member

thedodd commented Oct 10, 2020

@hamza1311 thanks for being vigilant and reporting all of these issues. Very helpful! 0.7.2 is already in pipeline for release.

@thedodd thedodd self-assigned this Oct 10, 2020
@thedodd thedodd added the bug Something isn't working label Oct 10, 2020
@L0g4n
Copy link
Contributor

L0g4n commented Oct 12, 2020

Thanks for that fix! This fixed for me that my CSS was broken when I got redirected to my 404 page 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants