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

Asset inline limit config when using views and static files #8166

Closed
wants to merge 1 commit into from

Conversation

lukesnowden
Copy link

Production build will fail using Vite::asset() if file is less than 4kb.

@jessarcher
Copy link
Member

I'd be inclined to always enable this via https://github.com/laravel/vite-plugin

Alternatively, we could update the Vite class to render the base64.

@timacdonald
Copy link
Member

timacdonald commented Aug 27, 2022

I think I'd be keen to set it to 0 in the plugin, respecting userland config of course.

I don't think we can generally assume the file will still be in it's pre-bundled location (e.g. resources/images/pixel.png) as apps may clear that stuff out for space reasons (e.g. Serverless). Encoding at runtime also kinda sucks as well - and the inconsistency is a little weird.

At least if you specify it, you are opting into the behaviour and can handle it in your own app.

@timacdonald
Copy link
Member

Pull request: laravel/vite-plugin#131

@lukesnowden
Copy link
Author

I’m happy either way I just wanted to shine a light on the fact it breaks in production which no one wants

@lukesnowden
Copy link
Author

Also thanks to Jaap for figuring it out for me https://stackoverflow.com/questions/73502963/larave-vite-vite-manifest-missing-odd-files

@timacdonald
Copy link
Member

Appreciate it @lukesnowden! I was unaware this was a Vite feature. I think we should head down the path of fixing in the plugin as Jess suggested, so I will close this one.

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

Successfully merging this pull request may close these issues.

3 participants