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

[backend-integration] processing assets not directly used by Vite #8373

Closed
4 tasks done
lubomirblazekcz opened this issue May 28, 2022 · 2 comments · Fixed by #16087
Closed
4 tasks done

[backend-integration] processing assets not directly used by Vite #8373

lubomirblazekcz opened this issue May 28, 2022 · 2 comments · Fixed by #16087

Comments

@lubomirblazekcz
Copy link
Contributor

Clear and concise description of the problem

If static assets are referenced in templates on backend (.twig, .blade, .latte, etc.), Vite will not process them and they are not included in manifest file.

A way how to get around that is described here #2375 (comment)

Suggested solution

rollupOptions.input should accept any kind of file type, including png, jpg, svg, etc and treat them as assets. This is not currently possible and are generated as empty chunks.

Generated an empty chunk: "fragment.svg"
Generated an empty chunk: "icon.png"

Alternative

No response

Additional context

No response

Validations

@lubomirblazekcz
Copy link
Contributor Author

What about introducing option like build.assetsInput as string[] with glob paths?

And each glob could then include assets viaimport.meta.glob('/path/to/assets/**') perhaps? This way they could be added to build as described in #2375 (comment)

@dreampasssser
Copy link

Oh, I had a similar problem when I pack a mpa.

I use <img src="@images/picture.jpg" alt="" /> directly in a html and I also put the picture into rollupOptions.input, but it became an empty js after build, and there's a info like this:

Generated an empty chunk: "images\picture".

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants