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

Static assets #15

Open
julienes opened this issue May 22, 2022 · 1 comment
Open

Static assets #15

julienes opened this issue May 22, 2022 · 1 comment

Comments

@julienes
Copy link

First of all thank you for this project. I was able to adapt it to my workflow, and it works very well! The only problem I can't solve is with static assets called outside of css or js. For images called via PHP, these are not compiled in the dist folder. The only thing that I found in the Vite doc is this one:
Also make sure the server is configured to serve static assets in the Vite working directory, otherwise assets such as images won't be loaded properly.

Do you have any clue to solve this problem?

Thank you,

Julien

@jc745
Copy link

jc745 commented Jan 26, 2023

@julienes you can use Vite's glob import to solve this.

In this case, just add import.meta.glob(['./assets/images/**']); to /src/main.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants