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

Theme assets missing in MPA mode #1401

Closed
3 tasks done
tommie opened this issue Sep 26, 2022 · 4 comments · Fixed by #3115
Closed
3 tasks done

Theme assets missing in MPA mode #1401

tommie opened this issue Sep 26, 2022 · 4 comments · Fixed by #3115
Labels
experimental Related to experimental features stale

Comments

@tommie
Copy link

tommie commented Sep 26, 2022

Describe the bug

When using img src=../static/image.png with --mpa, the assets don't make it to the output.

Reproduction

Build a theme component like

<template>
  <img src="../static/logo.svg">
</template>

And an image in .vitepress/theme/static/logo.svg.

Run vitepress build.

Expected behavior

That .vitepress/dist/assets/logo.XXXXXX.svg is present after build.

System Info

Vitepress 1.0.0-alpha15

Additional context

Changing bundle() so it runs build(resolveViteConfig(false) even in MPA mode brings the theme assets over.

(What I'm after is a mode that doesn't include the sitemap on every HTML page. I'm happy to run JS in the client. Was just playing with MPA to see if that would help.)

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@tommie tommie added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 26, 2022
@brc-dd brc-dd added bug Something isn't working build Related to the build system and removed bug: pending triage Maybe a bug, waiting for confirmation labels Sep 26, 2022
@brc-dd
Copy link
Member

brc-dd commented Sep 26, 2022

Yeah I'd noticed this earlier too (#848 (comment)). But considering the default theme is mostly broken too without client js, I don't think MPA can ever be fully supported.

@kiaking
Copy link
Member

kiaking commented Oct 20, 2022

Yeah... I think we should document this when we add mpa mode documentation saying that it wouldn't work with Default Theme and that it's meant for more simple usage.

@kiaking kiaking added docs Improvements or additions to documentation and removed bug Something isn't working labels Oct 20, 2022
@brc-dd
Copy link
Member

brc-dd commented Mar 16, 2023

Docs are updated: https://vitepress.dev/guide/mpa-mode, but still thinks that assets needs to be properly resolved (shouldn't be related to JS, somewhere the logic is wrong IG)

@Pandapip1
Copy link

I am also having this issue. Any chance this can be fixed?

@brc-dd brc-dd added bug Something isn't working experimental Related to experimental features and removed bug Something isn't working build Related to the build system labels Aug 4, 2023
@github-actions github-actions bot added the stale label Sep 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experimental Related to experimental features stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants